{"name":"filter-obj","version":"1.0.0","description":"Filter object keys and values into a new object","license":"MIT","repository":{"type":"git","url":"https://github.com/sindresorhus/filter-obj"},"author":{"name":"Sindre Sorhus","email":"sindresorhus@gmail.com","url":"sindresorhus.com"},"engines":{"node":">=0.10.0"},"scripts":{"test":"xo && node test.js"},"files":["index.js"],"keywords":["filter","obj","object","key","keys","value","values","val","iterate","iterator"],"devDependencies":{"ava":"0.0.4","xo":"*"},"gitHead":"98cbfe2788d066e3d200870e0436838e2756f0e3","bugs":{"url":"https://github.com/sindresorhus/filter-obj/issues"},"homepage":"https://github.com/sindresorhus/filter-obj","_id":"filter-obj@1.0.0","_shasum":"0dc98be70bd95536b441a925be21f58f911a9a77","_from":".","_npmVersion":"2.11.2","_nodeVersion":"0.12.5","_npmUser":{"name":"sindresorhus","email":"sindresorhus@gmail.com"},"dist":{"shasum":"0dc98be70bd95536b441a925be21f58f911a9a77","tarball":"http://registry-npm.ywwl.com/filter-obj/download/filter-obj-1.0.0.tgz","integrity":"sha512-mxzm5VZnIOiNbV+mFgpcdiys5aV1lCpwTb6VK98H3FQT/GOsAEl/25cBXeJKfkxa3gNeF7DzvXF2d2LOPUT7Qw==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIEqujGq+zNMR1lHsqjPPHVK5cCSDozMjP3HkBchnK1JSAiEAvQGTUtjzXGEEXZp2F3rVTMg8CdwL/+X4CjNYN1oCoFA="}],"size":1639,"noattachment":false,"key":"/filter-obj/-/filter-obj-1.0.0.tgz"},"maintainers":[{"name":"sindresorhus","email":"sindresorhus@gmail.com"}],"directories":{},"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":1439185585958,"_cnpm_publish_time":1439185585958,"dist-tags":{"latest":"6.1.0"}}