{"name":"filter-obj","version":"5.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","types":"./index.d.ts","engines":{"node":">=14.16"},"scripts":{"test":"xo && ava && tsd"},"keywords":["filter","object","key","keys","value","values","iterate","iterator","include","exclude","pick","omit"],"devDependencies":{"ava":"^4.3.1","tsd":"^0.22.0","xo":"^0.51.0"},"gitHead":"e7d096f25cf89a0c3eb311739a8ea35e3be84997","bugs":{"url":"https://github.com/sindresorhus/filter-obj/issues"},"homepage":"https://github.com/sindresorhus/filter-obj#readme","_id":"filter-obj@5.0.0","_nodeVersion":"14.19.3","_npmVersion":"8.3.2","dist":{"integrity":"sha512-hpwn4jAynTAA/005cXMPZo0Xqt8RE718HFCMdnZtdNA20uiybo3k5P1gbjGEiQ0xH38suno92S8xPFyuQybOJQ==","shasum":"32d0c213de3f8428a80b4d03f066f0ba7bf7ba04","tarball":"http://registry-npm.ywwl.com/filter-obj/download/filter-obj-5.0.0.tgz","fileCount":5,"unpackedSize":6099,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQCGx9ilB1iUlrbL4xxkVWzGGpVTNhQ60Fwc1BPfC8gzdQIhAOIcyS1/yPhd0VO3oEGjMxbEjwUxHhqE94WQk7O0VnPt"}],"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJi38k1ACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2Vmoinw//bxIDYOQ146frxS6x0YdDkD7eTWgFRhuRL0zkRHvYldKf8k2T\r\n5PQpPvq4YbN7lXCmLAFl/WdmKC28ONnR2zaYRNLGoMc3UL2DPMVjpDnd9Yyj\r\ndsTG1h4uGV60hZu9cPVnNtjprAPUsebxC4spPK8od4qaQNR2wmqdMZySFejF\r\nFZz9uZogOfQFSrwC8tnO56+ICaAGmdpI8WgOA9K9chNhHUYfzBgZZSS8/qlx\r\nwt0P9BKHCoceNqw2FA1qS+kZdwow7fPHlGtgtQmh4xv0RxoWgFq4XvylMY5Z\r\nDtXdMKd3K2/kCASDcRgii1KJIYJhrdEKmT9buTygUHd8LtET5LJfooh/8Lct\r\nSwHNuvFayzSJhFgeX19mZEAUV8hCsMpN5oNgh8J2zGOCqZ3rcXKfSOaupMa4\r\nd/qcCRAC7lmu7E4PvtJ4iICt5u+4eH4PiP1I4mm6ZVkKaImmXKgL0IMvfe2D\r\n2f4vt6VSwdlEvrsXy6st6/5qyvj3c0IdvZd0xmhHE19+3cgyM9S80nDGgj2m\r\nwmcpYOtfQqJN5OFPiwBEli8d6ozyWLrg0JvzGLXaLEdrOH9LhSP2O8k4mSrH\r\nSn/PEaIbl5XwzuzW9kBYeOpS0DFgfNCxYpXySZXZl8ZJQv8GCgx2j1yD3Kap\r\n0TfAoE1W8h6pVR1iAm3Gxqh6fV/1mWEAUaY=\r\n=h3vD\r\n-----END PGP SIGNATURE-----\r\n","size":2175,"noattachment":false,"key":"/filter-obj/-/filter-obj-5.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_5.0.0_1658833205701_0.9988291572626318"},"_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":1658833205898,"_cnpm_publish_time":1658833205898,"dist-tags":{"latest":"6.1.0"}}