{"id":16823347,"url":"https://github.com/digitalbrainjs/isequalobjects","last_synced_at":"2025-04-11T04:13:47.052Z","repository":{"id":57277144,"uuid":"213691607","full_name":"DigitalBrainJS/isEqualObjects","owner":"DigitalBrainJS","description":"Check whether objects are equal in deep","archived":false,"fork":false,"pushed_at":"2024-09-29T08:24:19.000Z","size":288,"stargazers_count":1,"open_issues_count":1,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-04-11T04:13:25.737Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/DigitalBrainJS.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2019-10-08T16:10:42.000Z","updated_at":"2023-04-21T17:51:05.000Z","dependencies_parsed_at":"2024-10-24T09:38:37.735Z","dependency_job_id":"f2fa7406-0ddb-4394-8b24-71bdb55963ef","html_url":"https://github.com/DigitalBrainJS/isEqualObjects","commit_stats":{"total_commits":17,"total_committers":1,"mean_commits":17.0,"dds":0.0,"last_synced_commit":"555bd6adba824617ef419b510ac6de8a93b123b2"},"previous_names":[],"tags_count":4,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/DigitalBrainJS%2FisEqualObjects","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/DigitalBrainJS%2FisEqualObjects/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/DigitalBrainJS%2FisEqualObjects/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/DigitalBrainJS%2FisEqualObjects/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/DigitalBrainJS","download_url":"https://codeload.github.com/DigitalBrainJS/isEqualObjects/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248339225,"owners_count":21087215,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-10-13T11:07:43.779Z","updated_at":"2025-04-11T04:13:47.035Z","avatar_url":"https://github.com/DigitalBrainJS.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# is-equal-objects\n[![Build Status](https://travis-ci.com/DigitalBrainJS/isEqualObjects.svg?branch=master)](https://travis-ci.com/DigitalBrainJS/isEqualObjects)\n[![](https://badgen.net/bundlephobia/min/is-equal-objects)](https://unpkg.com/is-equal-objects/dist/is-equal-objects.umd.js)\n[![](https://badgen.net/bundlephobia/minzip/is-equal-objects)](https://unpkg.com/is-equal-objects/dist/is-equal-objects.umd.js)\n[![](https://badgen.net/npm/license/is-equal-objects)](https://unpkg.com/is-equal-objects/dist/is-equal-objects.umd.js)\n[![](https://badgen.net/github/issues/DigitalBrainJS/isEqualObjects)](https://github.com/DigitalBrainJS/isEqualObjects/issues)\n[![](https://badgen.net/github/stars/DigitalBrainJS/isEqualObjects)](https://github.com/DigitalBrainJS/isEqualObjects/stargazers)\n[![Coverage Status](https://coveralls.io/repos/github/DigitalBrainJS/isEqualObjects/badge.svg?branch=master)](https://coveralls.io/github/DigitalBrainJS/isEqualObjects?branch=master)\n\nCheck whether objects are equal in deep. Useful for checking options objects. \n\n# Features\n-  Arrays and flat objects (whose constructor is Object and _proto_ is Object.prototype) will be deeply tested\n-  NaN === NaN\n-  Date, Regexp will be checked by reference or value, other complex objects will be simply compared by reference\n-  Circular references to objects will be compared by reference \n-  No dependencies\n-  CDN friendly\n\n## Installation\n\nInstall for node.js or browserify using npm/yarn:\n\n``` bash\n$ npm install is-equal-objects --save\n```\n\n``` bash\n$ yarn add is-equal-objects\n```\n\n````javascript \nimport isEqualObjects from 'is-equal-objects/esm';\n//OR\nconst isEqualObjects= require('is-equal-objects');   \n````\n## CDN\nUse unpkg.com cdn to get the link to the script/module from the package:\n- minified UMD ES5 version (~1kB)\n```html\n\u003cscript src=\"https://unpkg.com/is-equal-objects\"\u003e\u003c/script\u003e\n\u003cscript\u003e\n    isEqualObjects({x:1}, {x:1})//true\n\u003c/script\u003e\n```\n- ESM ES2015 module(~2kB)\n```javascript\nimport {isEqualObjects, cloneObject} from \"https://unpkg.com/is-equal-objects/dist/is-equal-objects.esm.js\"\n//or minified version\nimport {isEqualObjects, cloneObject} from \"https://unpkg.com/is-equal-objects/dist/is-equal-objects.esm.min.js\"\n```\n\n## Usage examples\nBasic usage:\n````javascript\n    isEqualObjects(1, 1); //true\n    isEqualObjects({x:1}, {x:1}); //true\n    isEqualObjects({x:1}, {x:1}, {x:1}); //true\n    isEqualObjects([{x:1}], [{x:1}]); //true\n    isEqualObjects([{x:[1]}], [{x:[1]}]); //true\n\n    const complexObj= Object.create({});\n    Object.assign(complexObj, {x:1});\n    isEqualObjects({x:1}, complexObj); //false, complexObj is not a flat object, test by reference \n\n    isEqualObjects(new Date(1995, 11, 17), new Date(1995, 11, 17)); //true\n    isEqualObjects(/\\s+/, /\\s+/); //true\n\n     isEqualObjects(\n            Object.create({\n                [isEqualObjects.plainObject]: true,\n                x: 123\n            }), \n            Object.create({\n                [isEqualObjects.plainObject]: true,\n                x: 123\n            })\n     ); // true\n\n     isEqualObjects.call({\n        comparator(obj1, obj2){\n           return obj1.x === obj2.x;\n        }\n     }, {x: 123, ignoredProp: 456}, {x:123, ignoredProp: 987});\n\n// cloneObject usage\n\n     const sourceObj= {x: {y: new Date()}};\n\n     const clonedObject = cloneObject(sourceObj);\n     \n     console.log(sourceObj.x === clonedObj.x); // false\n     console.log(sourceObj.x.y === clonedObj.x.y); // false\n     console.log(isEqualObjects(sourceObj, clonedObject)); // true\n````\n## API\n\n### isEqualObjects(...objects: any): Boolean\n\n  - `...objects` objects to check\n  \n  **returns** `false`, if the objects are not deeply equal, `true` otherwise  \n  \n  Additional options can be passed via function context (`this`):\n  \n  - `comparator(obj1: any, obj2: any): boolean|undefined` - a custom object comparator\n  \n### cloneObject(obj: any): any\n\n - `obj` any object to clone\n \n  **returns** a deep copy of the object\n\n## Contribution\n Feel free to fork, open issues, enhance or create pull requests. \n## License\n\nThe MIT License\n\nCopyright (c) 2019 Dmitriy Mozgovoy \u003crobotshara@gmail.com\u003e\n\nPermission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the \"Software\"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdigitalbrainjs%2Fisequalobjects","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdigitalbrainjs%2Fisequalobjects","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdigitalbrainjs%2Fisequalobjects/lists"}