{"name":"filter-obj","version":"2.0.1","description":"Filter object keys and values into a new object","license":"MIT","repository":{"type":"git","url":"git+https://github.com/sindresorhus/filter-obj.git"},"author":{"name":"Sindre Sorhus","email":"sindresorhus@gmail.com","url":"sindresorhus.com"},"engines":{"node":">=8"},"scripts":{"test":"xo && ava && tsd"},"keywords":["filter","object","key","keys","value","values","iterate","iterator"],"devDependencies":{"ava":"^2.4.0","tsd":"^0.9.0","xo":"^0.25.3"},"gitHead":"f0e4a127c9805675f87b57d3cdd70872bb23b5a3","bugs":{"url":"https://github.com/sindresorhus/filter-obj/issues"},"homepage":"https://github.com/sindresorhus/filter-obj#readme","_id":"filter-obj@2.0.1","_nodeVersion":"10.16.3","_npmVersion":"6.11.3","_npmUser":{"name":"sindresorhus","email":"sindresorhus@gmail.com"},"dist":{"integrity":"sha512-yDEp513p7+iLdFHWBVdZFnRiOYwg8ZqmpaAiZCMjzqsbo7tCS4Qm4ulXOht337NGzkukKa9u3W4wqQ9tQPm3Ug==","shasum":"34d9f0536786f072df7aeac3a8bda1c6e767aec6","tarball":"http://registry-npm.ywwl.com/filter-obj/download/filter-obj-2.0.1.tgz","fileCount":5,"unpackedSize":4115,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJdltbzCRA9TVsSAnZWagAAWVYQAI6WqvAil1ohkhgSaWU7\n7uZLvCy6q3Ph6bZhIcl6T39/m0kMR15E8xW6VF70tCMUBrcVnJldTihjrrii\noQreqU16Vhu+H9ldgW71oXb5N1ujzTWatPhmKpN5PqVOY1Rr80+WqhPqesV0\nmu5sB06KGCFBLMm5ScM4qNnabph1WOJWD0NxJDF+YqxgRV6k5bclfLgbZU3E\nwxjjtFOIMnxkAi9ga37U/dTchzxOcl8hhs0i+/OePeS2AdXsiH15fYW7w0H9\nayO33lB40zTACedCbLwqPoxRYiidtHcR5sG2kcZzVfDBqUqlOJQSwrAGYAwv\nfE5xeegqUEZQJSuZ+rdrsk+xriwoBNTBbGG1fvSlciwhSvrBL/4hqte0Tu4+\n6DLTw5oICBpkjbiOkIfUrxxQSSpteFcZwumVQWfoFQDVYn2bVRNtBqIpuh9w\nvuV5kHGgtoms4F/VHebRDayCU5mW0zaUhUsBBhXYdkF/kv4C5YClyJ+8k0G+\nRTOoWvLhnHN7txjeNjQHnniXxvkoKPuFuE59pMlOIFH7QoaPt88NApWgMHIL\nlSEwuFqtuFWA36tq+PnU5e8SKrCQeUThnvOLN/dPjJIlpBaokxWPu5Z8pGqw\nnM4gooqXdcIWHfDQI0iPibKkk6GehDLwn4/IjamPkJi0/XqkrOoKxvv2Bxlh\n4IQh\r\n=/Yam\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQCN7Mj+dbEHjcbm0LOaMDZGp7KexxLnxQ859dTZVfiQlwIhAN/12PiqcNHtdPHrUjcKKvTg0hWiQXp3aCsds24ov8YY"}],"size":1938,"noattachment":false,"key":"/filter-obj/-/filter-obj-2.0.1.tgz"},"maintainers":[{"name":"sindresorhus","email":"sindresorhus@gmail.com"}],"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/filter-obj_2.0.1_1570166514492_0.9860839372631538"},"_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":1570166514668,"_cnpm_publish_time":1570166514668,"dist-tags":{"latest":"6.1.0"}}