{"name":"filter-obj","version":"6.1.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":{"types":"./index.d.ts","default":"./index.js"},"sideEffects":false,"engines":{"node":">=18"},"scripts":{"test":"xo && ava && tsd"},"keywords":["filter","object","key","keys","value","values","iterate","iterator","include","exclude","pick","omit"],"devDependencies":{"ava":"^6.1.2","tsd":"^0.30.7","xo":"^0.58.0"},"_id":"filter-obj@6.1.0","gitHead":"7bcfe43cb7bfa8fd553110e0a04043e73f5e78f9","types":"./index.d.ts","bugs":{"url":"https://github.com/sindresorhus/filter-obj/issues"},"homepage":"https://github.com/sindresorhus/filter-obj#readme","_nodeVersion":"18.20.2","_npmVersion":"10.6.0","dist":{"integrity":"sha512-xdMtCAODmPloU9qtmPcdBV9Kd27NtMse+4ayThxqIHUES5Z2S6bGpap5PpdmNM56ub7y3i1eyr+vJJIIgWGKmA==","shasum":"58725ceed8f0de54b432d74b6a3eb149453d7ed0","tarball":"http://registry-npm.ywwl.com/filter-obj/download/filter-obj-6.1.0.tgz","fileCount":5,"unpackedSize":6608,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIE9rX/Uv9tNHzE4NrRWbeFXofWJ1I/C5UcoyeTsUiIrOAiA0WbpcbZm8voMPHY+qBmgVpvDjYlkzX8HALcCg85Uj8w=="}],"size":2449,"noattachment":false,"key":"/filter-obj/-/filter-obj-6.1.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_6.1.0_1716806921876_0.012522757481228108"},"_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":1716806922084,"_cnpm_publish_time":1716806922084,"dist-tags":{"latest":"6.1.0"}}