{"name":"filter-obj","version":"2.0.2","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":"e3e22ef3566cbf8c7b2e8106ece0c59cd6bfcf08","bugs":{"url":"https://github.com/sindresorhus/filter-obj/issues"},"homepage":"https://github.com/sindresorhus/filter-obj#readme","_id":"filter-obj@2.0.2","_nodeVersion":"12.20.1","_npmVersion":"6.14.10","_npmUser":{"name":"sindresorhus","email":"sindresorhus@gmail.com"},"dist":{"integrity":"sha512-lO3ttPjHZRfjMcxWKb1j1eDhTFsu4meeR3lnMcnBFhk6RuLhvEiuALu2TlfL310ph4lCYYwgF/ElIjdP739tdg==","shasum":"fff662368e505d69826abb113f0f6a98f56e9d5f","tarball":"http://registry-npm.ywwl.com/filter-obj/download/filter-obj-2.0.2.tgz","fileCount":5,"unpackedSize":4038,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgbCPxCRA9TVsSAnZWagAAY/sP/1SEzMz4CV6E/NpdY6ib\nKiXtrXoj/gfZ3P8W6dnPYgQGE3qDeR6pYmO7KgfH8jIcipEgCjd4UwHvcqB7\nnqlPvlUqKiD8PwUHzR8yBWpfzuHyBkvXfAZt34BSKj5LOmVgamNbEUAjPpGE\nvnRInW62TnqczfYps4kQnZMmQK111MAA+0O1RX0luUrpySsord+aA7Dp/Bay\nxcr8Ur0uSupuR1C1NdpYXjpquEgWzxxQKBwYugZyydaDV1He+ocZMjDqfnel\nfPcMOSqc873HYvvUKcLEAyO1RITt2gcK2hyCRpr+fbkvIN/0GNlMXSQUIXFV\nb7kpIMyoSJjwOSmlAmd2cs4Aef2eSI1UBMeV9kg650SXoOYJvW/PRnYOgYss\nDROcyonZoDTIkd3aFSoGi8nh253xFFYiJXK1d1IS5IRq3zjl+yz8eJuXZnAQ\nCmxFVuhzVrnZiprCz1AEbdovZgS0oI3YpjoHHnx+kHUu3UWsSPIJpP79BbRK\ne3C8HB9FcOWjAH3KTVUgHPvtZBkOQb8NcEw3MfOQYr1nnYZXLKdZ0vAIlA/u\nQtbM2GlfGQnJwBTGyZcnRwKYKSF0ljvBA2RFvp1pmG7b2ljLC5WYkMUHYWSU\nLkFJX49xjp/jFHfhKnY9sJVpUb1kLT8+Yw34LrD8PAJqUwockeLtSDGtWLd1\nMhXA\r\n=GS1z\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQCvawgVORumO4/7CbhkMNJkN84qI8q5aZew7+KdNVaP6QIhAKxCdIzvTGD9Yidx6BM8CYMqe2PpQ4X2vESpf3m9u4jG"}],"size":1899,"noattachment":false,"key":"/filter-obj/-/filter-obj-2.0.2.tgz"},"directories":{},"maintainers":[{"name":"sindresorhus","email":"sindresorhus@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/filter-obj_2.0.2_1617699825000_0.41915551359931746"},"_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":1617699825120,"_cnpm_publish_time":1617699825120,"dist-tags":{"latest":"6.1.0"}}