{"id":15547298,"url":"https://github.com/uhop/deep6","last_synced_at":"2025-04-15T11:12:59.894Z","repository":{"id":37954298,"uuid":"310115026","full_name":"uhop/deep6","owner":"uhop","description":"No dependency mini-library: deep equivalency, object pattern matching, deep cloning, unification.","archived":false,"fork":false,"pushed_at":"2024-10-07T19:42:35.000Z","size":509,"stargazers_count":8,"open_issues_count":7,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-04-15T11:12:40.233Z","etag":null,"topics":["deep-equal","deep-equals","unification"],"latest_commit_sha":null,"homepage":"","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"other","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/uhop.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":".github/FUNDING.yml","license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":"AUTHORS","dei":null,"publiccode":null,"codemeta":null},"funding":{"github":"uhop","buy_me_a_coffee":"uhop"}},"created_at":"2020-11-04T20:51:32.000Z","updated_at":"2024-07-16T22:28:45.000Z","dependencies_parsed_at":"2024-06-13T07:17:43.121Z","dependency_job_id":"6902e8fb-a7a6-46a7-96f6-3c2ec8ed0322","html_url":"https://github.com/uhop/deep6","commit_stats":{"total_commits":259,"total_committers":3,"mean_commits":86.33333333333333,"dds":0.2625482625482626,"last_synced_commit":"cc4b603821cd1d5ed4ee0b28b546af38262464a8"},"previous_names":[],"tags_count":21,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/uhop%2Fdeep6","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/uhop%2Fdeep6/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/uhop%2Fdeep6/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/uhop%2Fdeep6/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/uhop","download_url":"https://codeload.github.com/uhop/deep6/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":249058384,"owners_count":21205911,"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":["deep-equal","deep-equals","unification"],"created_at":"2024-10-02T13:08:35.366Z","updated_at":"2025-04-15T11:12:59.875Z","avatar_url":"https://github.com/uhop.png","language":"JavaScript","funding_links":["https://github.com/sponsors/uhop","https://buymeacoffee.com/uhop"],"categories":[],"sub_categories":[],"readme":"# deep6 [![NPM version][npm-image]][npm-url]\n\n[npm-image]: https://img.shields.io/npm/v/deep6.svg\n[npm-url]:   https://npmjs.org/package/deep6\n\n`deep6` is a no-dependency ES6 mini-library:\n\n* Advanced deep equivalency for JavaScript structures.\n  * Extensible to accommodate custom objects.\n* Traversing objects.\n  * Extensible deep cloning.\n* Written in ES6:\n  * Use it in Node or browsers without transpiling.\n  * Natively supports `Map`, `Set`, typed arrays.\n  * Natively supports symbols and property descriptors.\n  * Presented as ES6 modules, yet provides CommonJS modules for convenience.\n* Efficient non-recursive algorithms.\n  * ~500 tests to ensure correctness.\n  * Support for circular dependencies.\n  * Support for \"loose\" comparisons.\n* Unification.\n  * Identifying and capturing object fragments.\n\n## Intro\n\n```js\nimport equal, {match, clone, any} from 'deep6';\n\nconst x = {a: 1, b: 2, c: ['hi!', 42, null, {}]};\n\n// deep equality\nequal(x, {b: 2, a: 1, c: ['hi!', 42, null, {}]});     // true\nequal(x, {b: 2, a: 1, c: ['hi!', 42, null, {z: 1}]}); // false\n\n// pattern matching\nmatch(x, {a: 1});         // true\nmatch(x, {z: 1});         // false\nmatch(x, {a: 1, c: any}); // true\nmatch(x, {a: 1, c: []});  // false\nmatch(x, {a: 1, d: any}); // false\n\n// deep cloning\nconst y = clone(x);\nequal(x, y);              // true\n\n// circular dependencies are fine\nconst z = {},\n  w = {};\nz.z = z;\nw.z = w;\nconst p = clone(w);\nequal(z, w);              // true\nequal(z, p);              // true\n\n// more standard types\nconst m = {a: new Map(), b: Buffer.from([99, 98, 97])};\nm.a.set('a', [Symbol(), new Set([1, 2, 3])]);\nm.a.set('b', [/^abc/i, new Date()]);\nconst n = clone(m);\nequal(m, n);              // true\n\n// advanced: symbols\nconst s = Symbol(),\n  t = {[s]: 42, [Symbol.for('deep6')]: 33},\n  u = {[s]: 42, [Symbol.for('deep6')]: 33},\n  v = clone(u, {symbols: true});\nequal(t, u, {symbols: true}); // true\nequal(t, v, {symbols: true}); // true\n\n// advanced: clone non-enumerable properties\nconst r = {a: 1};\nObject.defineProperty(r, 'b', {value: 2, enumerable: false});\nconst q = clone(r, {allProps: true});\nr === q;                  // false\nequal(r, {a: 1});         // true\nequal(r, {a: 1, b: 2});   // false\nr.a === q.a;              // true\nr.b === q.b;              // true\n```\n\n## Docs\n\nAll pertinent information is in the [wiki](https://github.com/uhop/deep6/wiki).\n\n## Installation and use\n\n```bash\nnpm install --save deep6\n```\n\n```js\n// ES6 modules\nimport equal, {clone} from 'deep6';\nimport matchString from 'deep6/unifiers/matchString';\n```\n\n```js\n// CommonJS modules\nconst {equal, clone} = require('deep6/cjs');\nconst matchString = require('deep6/cjs/unifiers/matchString').default;\n```\n\n## License\n\nBSD-3-Clause\n\n## Release History\n\n- 1.1.4 *updated dev deps.*\n- 1.1.3 *updated dev deps.*\n- 1.1.2 *updated dev deps.*\n- 1.1.1 *reformulated `any` as a well-known symbol.*\n- 1.1.0 *separated from [yopl](https://npmjs.org/package/yopl), extensive refactoring.*\n- 1.0.1 *added the exports statement.*\n- 1.0.0 *the first 1.0 release.*\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fuhop%2Fdeep6","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fuhop%2Fdeep6","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fuhop%2Fdeep6/lists"}