{"name":"filter-obj","version":"3.0.0","description":"Filter object keys and values into a new object","license":"MIT","repository":{"type":"git","url":"git+https://github.com/sindresorhus/filter-obj.git"},"funding":"https://github.com/sponsors/sindresorhus","author":{"name":"Sindre Sorhus","email":"sindresorhus@gmail.com","url":"https://sindresorhus.com"},"type":"module","exports":"./index.js","engines":{"node":"^12.20.0 || ^14.13.1 || >=16.0.0"},"scripts":{"test":"xo && ava && tsd"},"keywords":["filter","object","key","keys","value","values","iterate","iterator"],"devDependencies":{"ava":"^3.15.0","tsd":"^0.17.0","xo":"^0.44.0"},"gitHead":"603e73ca5cd0737ee80a8862ca06610e26bf1405","bugs":{"url":"https://github.com/sindresorhus/filter-obj/issues"},"homepage":"https://github.com/sindresorhus/filter-obj#readme","_id":"filter-obj@3.0.0","_nodeVersion":"16.7.0","_npmVersion":"7.20.3","dist":{"integrity":"sha512-oQZM+QmVni8MsYzcq9lgTHD/qeLqaG8XaOPOW7dzuSafVxSUlH1+1ZDefj2OD9f2XsmG5lFl2Euc9NI4jgwFWg==","shasum":"dba2f9e64e921758ed9a51028ca2ed02d4cccbcf","tarball":"http://registry-npm.ywwl.com/filter-obj/download/filter-obj-3.0.0.tgz","fileCount":5,"unpackedSize":4168,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJhJ+LTCRA9TVsSAnZWagAAy4wQAJhFR08e7PAwscfsvns2\nzo8GqoWrgBlNnb8q5xVgS1++t9ktfaMGHrLWM09N3JHmOpGhmxmGJEIy5Zbm\ngX5Pe5nR0rqFf5fBg87ZfdD8CHZ9LTo1dT0bUyoN7CarMy2PHl2lIApNtI0V\n6pO8U5IqqT9Qc/Ep1Vq9Z2U6p4crjw2vSxvD/vALxzX0DH0PQhN0W4HMJoEe\nuutKFGC4bjuwV2GwPFjfFfE4PqEHNflfM9lwucIG/nBrVjhgaFNEBO7mHNZo\nA74vudtiJI/xYx/j4Xw/BO3e6eT9IkZgLx28jWIjm8LkqFuw/u+VA+Ss9PNa\nMLIbdCsGe7p5CHCAtISlCjEGk5yBacocELaQQE0iAEcjTiMW2d+vbKgXEo2q\nZn6O5Yk4zbbOZVe32RMbtPKxx/4BuzKXr61x9u6Pc5ArWm0uV8oVUK2xQA3G\nzW34JP6PRDPWmu6zGoUrOtOHCT0O2k4uzdpCIHQlrIe5FTgZ0Ap66McPutiZ\nOkVZU8hoV36cbMZFqKohyWEjG7LqaWgKbLN/OBisCZysLns/PwAYN3hheV6O\n7ue7h49HFKled2mYH2e9blZfPTX1T6calI37tYjl9QD1mZPa0sGK+5cI2LvD\nXQy/u3dzvEQ052AXxxzFZNR8HBbAzKx/MurUqrVuEmy/G32zTIzw1IEhoHap\nW1bJ\r\n=PBef\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIF2khXsiPEtUbZ3vuE3YWWupUrpjko/D3MPMEPFh8B1DAiBEMGsZAoPU8V4SS6LIYzeGXSuEi4NdOFLSQFlLGNq+pA=="}],"size":1908,"noattachment":false,"key":"/filter-obj/-/filter-obj-3.0.0.tgz"},"_npmUser":{"name":"sindresorhus","email":"sindresorhus@gmail.com"},"directories":{},"maintainers":[{"name":"sindresorhus","email":"sindresorhus@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/filter-obj_3.0.0_1630003923754_0.2631078122775137"},"_hasShrinkwrap":false,"readme":"# filter-obj\n\n> Filter object keys and values into a new object\n\n## Install\n\n```sh\nnpm install filter-obj\n```\n\n## Usage\n\n```js\nimport {includeKeys, excludeKeys} from 'filter-obj';\n\nconst object = {\n\tfoo: true,\n\tbar: false\n};\n\nconst newObject = includeKeys(object, (key, value) => value === true);\n//=> {foo: true}\n\nconst newObject2 = includeKeys(object, ['bar']);\n//=> {bar: false}\n\nconst newObject = excludeKeys(object, (key, value) => value === true);\n//=> {bar: false}\n\nconst newObject3 = excludeKeys(object, ['bar']);\n//=> {foo: true}\n```\n\n## API\n\n### includeKeys(source, filter)\n### includeKeys(source, keys)\n### excludeKeys(source, filter)\n### excludeKeys(source, keys)\n\n#### source\n\nType: `object`\n\nThe source object to filter properties from.\n\n#### filter\n\nType: `(sourceKey: string | symbol, sourceValue: unknown, source: object) => boolean`\n\nA predicate function that determines whether a property should be filtered.\n\n#### keys\n\nType: `Array<string | symbol> | Set<string | symbol>`\n\nAn array or [`Set`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Set) of property keys to be filtered.\n\n## Related\n\n- [map-obj](https://github.com/sindresorhus/map-obj) - Map object keys and values into a new object\n","publish_time":1630003923929,"_cnpm_publish_time":1630003923929,"dist-tags":{"latest":"6.1.0"}}