{"name":"filter-obj","version":"5.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":"./index.js","types":"./index.d.ts","engines":{"node":">=14.16"},"scripts":{"test":"xo && ava && tsd"},"keywords":["filter","object","key","keys","value","values","iterate","iterator","include","exclude","pick","omit"],"devDependencies":{"ava":"^4.3.1","tsd":"^0.22.0","xo":"^0.51.0"},"gitHead":"58086b537bb622166387216bfb7da6e8184996ba","bugs":{"url":"https://github.com/sindresorhus/filter-obj/issues"},"homepage":"https://github.com/sindresorhus/filter-obj#readme","_id":"filter-obj@5.1.0","_nodeVersion":"14.19.3","_npmVersion":"8.3.2","dist":{"integrity":"sha512-qWeTREPoT7I0bifpPUXtxkZJ1XJzxWtfoWWkdVGqa+eCr3SHW/Ocp89o8vLvbUuQnadybJpjOKu4V+RwO6sGng==","shasum":"5bd89676000a713d7db2e197f660274428e524ed","tarball":"http://registry-npm.ywwl.com/filter-obj/download/filter-obj-5.1.0.tgz","fileCount":5,"unpackedSize":5936,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQCkYaZOYNiL0FIISi22luTAjgtFmbD6seV3NsRkZ4vlPwIhAMP5Lhbvz8lkPddlm1+nPI6GBdBMoxSlLxx7TBhgKIJx"}],"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJi5XIhACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2Vmpq1w/+NcsHuUVIxml8U0DGsoQ5U35Z58/IRLYU2LJkQANnR8fVPGpb\r\npJFYMvxPrHw8PG7sVeoNA1t5MeV4KhJQOWDTn3dvmDiO3eHGyTpwGtmH/0Fq\r\nOzjc1+VMOAsPvhBodEhxlG+t3/8/AIzoVt0uWq2Wj6JgjvgUI7FWFfsb6K6e\r\nxjtnQ/dXUx19YT94on+GsLn+g6IfiCD82Xpi9AFUOX/UlPmpqQSVu1O+NtHe\r\nUbj3mHvuyP1cQYMCNXQCUhwYnaemu60kGUj6KecnTZfJzmjpZWR9OvlMNjF3\r\n4G2pX/NgeJ2LHMuDKlug1bDXkhw+JdlgbuKBfdhMZUTnDF8ZKOVXL0ru7NwP\r\nKyIuK7iPswqvkqT3K2XPU/6191NCOqTErhIFywFX++F9sxn/DAr+fWUTmp+H\r\n6s2MlcZEfmgfsL30UbkB+3anREgz64sb7aaxGg48pf6xcXT1yWOrss5Bj94n\r\nFJuUwTG7b1cy8Our7mkE+YbHxlW7cI4EE99oDgs4z79i7ic0BX9NBgpdqW8R\r\n5nNybSj6aZxGWl4xY4bYvFOL8Dh6cMwTuZC2bjyz2K9zc9zy4ozh5eygoC0+\r\nwUQgl+wgbo+mtvf5GX9fJT5MVm1jx5sA6rdV+fJ8UXxzGsn43FTpObbLybDu\r\np2UOoILo5b7JDsu95cHESYDF2jWrqcmmnuw=\r\n=+nIe\r\n-----END PGP SIGNATURE-----\r\n","size":2141,"noattachment":false,"key":"/filter-obj/-/filter-obj-5.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_5.1.0_1659204129246_0.46245966459319354"},"_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":1659204129416,"_cnpm_publish_time":1659204129416,"dist-tags":{"latest":"6.1.0"}}