{"id":18873539,"url":"https://github.com/bartekleon/params-equal","last_synced_at":"2025-10-19T03:29:06.052Z","repository":{"id":48314424,"uuid":"147865033","full_name":"bartekleon/params-equal","owner":"bartekleon","description":"Checks if two elements are really equal","archived":false,"fork":false,"pushed_at":"2022-03-03T21:44:27.000Z","size":118,"stargazers_count":1,"open_issues_count":9,"forks_count":1,"subscribers_count":2,"default_branch":"master","last_synced_at":"2024-12-31T00:42:35.088Z","etag":null,"topics":["equal-objects","fast","is-equal","isequal","lib","typescript"],"latest_commit_sha":null,"homepage":null,"language":"TypeScript","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/bartekleon.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2018-09-07T19:16:10.000Z","updated_at":"2022-02-24T23:24:24.000Z","dependencies_parsed_at":"2022-09-21T10:22:06.934Z","dependency_job_id":null,"html_url":"https://github.com/bartekleon/params-equal","commit_stats":null,"previous_names":[],"tags_count":4,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bartekleon%2Fparams-equal","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bartekleon%2Fparams-equal/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bartekleon%2Fparams-equal/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bartekleon%2Fparams-equal/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/bartekleon","download_url":"https://codeload.github.com/bartekleon/params-equal/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":239825010,"owners_count":19703199,"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":["equal-objects","fast","is-equal","isequal","lib","typescript"],"created_at":"2024-11-08T05:35:13.653Z","updated_at":"2025-10-19T03:29:00.982Z","avatar_url":"https://github.com/bartekleon.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# param-type [![NPM version](https://img.shields.io/npm/v/params-equal.svg?style=flat)](https://www.npmjs.com/package/params-equal)\n\nIs function() {} = function() {}? Or {} = {}? \"hello\" = new String(\"hello\")?\nNow they are. **params-equal** checks if two given parameters are equal and works for cases, other programs do not check. Optimalised to be **as fast as it is possible** and **tested** to work as intended.\n\n## Install\n\nInstall with [npm](https://www.npmjs.com/):\n\n```sh\n$ npm install --save params-equal\n```\n\n```js\nimport paramsEqual from 'params-equal';\nor\nconst paramsEqual = require('params-equal').default;\n\nparamsEqual(NaN, NaN) //=\u003e true\n\nparamsEqual(NaN, 0 / 0) //=\u003e true\n\nparamsEqual(null, null) //=\u003e true\n\nparamsEqual(true, true) //=\u003e true\n\nparamsEqual(true, false) //=\u003e false\n\nparamsEqual(\"\", \"\") //=\u003e true\n\nparamsEqual(\"\", \"hi\") //=\u003e false\n\nparamsEqual(2, 2) //=\u003e true\n\nparamsEqual(2, 4) //=\u003e false\n\nparamsEqual(2, \"4\") //=\u003e false\n\nparamsEqual(-0, +0) // =\u003e false\n\nparamsEqual(Infinity, Infinity) // =\u003e true\n\nparamsEqual(Infinity, 1 / 0) // =\u003e true\n\nparamsEqual(-0, -0)) // =\u003e true\n\nparamsEqual(/a/g, /a/g) //=\u003e true\n\nparamsEqual(/a/g, /a/u) //=\u003e false\n\nparamsEqual(/b/g, /a/g) //=\u003e false\n\nparamsEqual(/a/g, new RegExp('a', 'g')) //=\u003e true\n\nparamsEqual(Symbol(12), Symbol(12)) //=\u003e true\n\nparamsEqual(Symbol(12), Symbol(\"12\")) //=\u003e true\n\nparamsEqual(Symbol(12), Symbol(6)) //=\u003e false\n\nparamsEqual(new Boolean(true), new Boolean(true)) //=\u003e true\n\nparamsEqual(new Boolean(true), new Boolean(false)) //=\u003e false\n\nparamsEqual(new Object(), new Object()) //=\u003e true\n\nparamsEqual([], []) //=\u003e true\n\nparamsEqual([1], []) //=\u003e false\n\nparamsEqual({}, []) //=\u003e false\n\nparamsEqual(function() {}, function() {}) //=\u003e true\n\nparamsEqual(function hi() {}, function() {}) //=\u003e false\n\nparamsEqual(() =\u003e {}, function() {}) //=\u003e false\n\nparamsEqual(function() {}, function() {return false; }) //=\u003e false\n\nparamsEqual(async function() {}, function() {}) //=\u003e false\n\nparamsEqual(new Date(), new Date(1256252)) //=\u003e false\n\nparamsEqual({ hi: { hello: 1 } }, { hi: { hello: \"1\" } }) //=\u003e false\n\nparamsEqual([{ hi: \"hello\" }, \"hi\"], [{ hi: \"hello\" }, \"hi\"]) //=\u003e true\n\nparamsEqual({\n  log: [],\n  set yo(name: string) {\n    this.log.push(name);\n  },\n  get yo() {\n    return \"this is set\";\n  }\n},\n{\n  log: [],\n  get yo() {\n    return \"this is set\";\n  }\n}) //=\u003e false\n\nparamsEqual({\n  log: [],\n  yo: \"this is set\"\n},\n{\n  log: [],\n  get yo() {\n    return \"this is set\";\n  }\n}) //=\u003e false\n\nparamsEqual({\n  log: [],\n  set yo(name: string) {\n    this.log.push(name);\n  },\n  get yo() {\n    return \"this is set\";\n  }\n},\n{\n  log: [],\n  set yo(name: string) {\n    this.log.push(name);\n  },\n  get yo() {\n    return \"this is set\";\n  }\n}) //=\u003e true\n\nconst a = { hi: \"hello\", s: {} };\nconst b = { hi: \"hello\", s: {} };\nconst c = { hi: \"h\", c: {} };\n\nc.c = c;\na.s = a;\nb.s = c;\nparamsEqual(a, b) //=\u003e RangeError(\"You are not allowed to create infinite nest\")\n```\n\n## Test\n\n- Unit tests:\n```sh\n$ npm install \u0026\u0026 npm test\n```\n\n### Author\n\n**kmdrGroch**\n\n### License\nCopyright © 2018, [kmdrGroch](https://github.com/kmdrgroch).\nReleased under the [MIT License](LICENSE).\n\n### Note\nThe code will work for node \u003e= 8, although there is a possibility that development tools won't work for some versions.","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbartekleon%2Fparams-equal","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fbartekleon%2Fparams-equal","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbartekleon%2Fparams-equal/lists"}