{"name":"filter-obj","version":"2.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"},"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":"^1.4.1","tsd":"^0.7.2","xo":"^0.24.0"},"gitHead":"19f652d405ea9f32903825486ecd1e8cb3bfc43d","bugs":{"url":"https://github.com/sindresorhus/filter-obj/issues"},"homepage":"https://github.com/sindresorhus/filter-obj#readme","_id":"filter-obj@2.0.0","_npmVersion":"6.4.1","_nodeVersion":"10.15.3","_npmUser":{"name":"sindresorhus","email":"sindresorhus@gmail.com"},"dist":{"integrity":"sha512-1zxy6OITvz/RlubpDlY6GG/eb38WAmSdy1j+LqxaqHhXYcFh/qIaLa+9usO2gaNSeVz8KgFUYubuX2gZhboziQ==","shasum":"a6d579ee8c0778b0fc5cc2a859bf6e08dbfc3bac","tarball":"http://registry-npm.ywwl.com/filter-obj/download/filter-obj-2.0.0.tgz","fileCount":5,"unpackedSize":4186,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJcvWkbCRA9TVsSAnZWagAArXUP/2m8OGcG59VwWoS+O9Pe\nNXW02M+9T1NjhEgQpyeF3zTN5QwEFUA6N7pP/A3bB0n6P/7w13/oQDA5Skqb\n141Wm0aVna+unsqUhryUmzT6cJTzkA87To93G1m1lIZv6kb3evtgRfQ3ofSb\nZb5Dxo44/6b/VPQo3zzOHf2QxyQJvyY5UhJ96T77HfxsXusgTt37gIKDF6XV\nJJj7wiy85pyfKLj8pbrkDlS21rJWHHfbvp2A3C0YM5tZ9OYWW6iWPbeL2Rih\nrFTfsKKBW4k3s6RtiVK5BfZOYnNyp124HeavmUAf8vDoBtz2V/mzK7IqpGDH\nGijwhvp+RmZFlqO+RAzaxB6Bbf9TAlo8gYc5ixG09QdL+Ke0Td95y6eVL91X\n+nuIWD5ovG6MeMul9/eP7Y0wE0qnZjk7mYIJyBv1Fpumd6XSaP+HSRz+vrnz\nutuXBEK03Hk4QZb0Q+xuf7D1R1WxOFfRbSmtbbYlVHsZ8Ch9RZXSGOVGRXQa\nnSV/0NkDHbgELSlN+lA8gUH7za9jbiJfc1CeuMNUXBqP10sJNUUwIC6xIrzs\nXwEeCSst096GQl5oDHffIFR1xplGfHMUT3hdZDhuBXUrgm30ntmodvpZzsVm\nSYri6KfWqYyU0VYxbr3UQAoZaJu3w+0+pthUNh0pAVdqqG2PraABlRcmNxFo\niu6v\r\n=hcBX\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQCqyMVd353DJUJPIzbHN/P6wwV40BctRHiGiTeO+c13sgIgOoKfjLUrh0MfkUuAI3isfiKTKWdJ1DMy74yRoYmyzl4="}],"size":1955,"noattachment":false,"key":"/filter-obj/-/filter-obj-2.0.0.tgz"},"maintainers":[{"name":"sindresorhus","email":"sindresorhus@gmail.com"}],"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/filter-obj_2.0.0_1555917083222_0.422539198901676"},"_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":1555917083383,"_cnpm_publish_time":1555917083383,"dist-tags":{"latest":"6.1.0"}}