{"_id":"decamelize-keys@2.1.0","bugs":{"url":"https://github.com/sindresorhus/decamelize-keys/issues"},"dist":{"shasum":"57bb7e5e6175b301c9465c101472bdb8c2b606b2","tarball":"http://registry-npm.ywwl.com/decamelize-keys/download/decamelize-keys-2.1.0.tgz","fileCount":5,"integrity":"sha512-YXq2MJwiW49oxbOvMj4RtoKqHcm09iqR9DbuYtF9eh+ve49Axta+VUDXqe2KT0U/jImBBjpW9XRUC+FfwvmuSg==","signatures":[{"sig":"MEYCIQDFNKtOMKGd5v1gYUc16zkhT73sGnojs+oHOJ0RbobNJwIhALpeKVzHM3xeMTbRCil7/XfY0yuqbgA8fc4RI/bCeXsC","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"},{"keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U","sig":"MEUCID+1MLSy+9QFw4Xfn3i7PZS2GDwD8qmVvEIzLN/oX/OQAiEA2BRKWgm+kdI7FtUj/KOljQpeMg7id6cFap1Odr1u/fY="}],"unpackedSize":11945,"size":4112,"noattachment":false,"key":"/decamelize-keys/-/decamelize-keys-2.1.0.tgz"},"name":"decamelize-keys","type":"module","types":"./index.d.ts","author":{"url":"https://sindresorhus.com","name":"Sindre Sorhus","email":"sindresorhus@gmail.com"},"engines":{"node":">=14.16"},"exports":{"types":"./index.d.ts","default":"./index.js"},"funding":"https://github.com/sponsors/sindresorhus","gitHead":"66bf5da7c0029879cb97b26c16c57c9c416af460","license":"MIT","scripts":{"test":"xo && ava && tsd"},"version":"2.1.0","_npmUser":{"name":"sindresorhus","email":"sindresorhus@gmail.com"},"homepage":"https://github.com/sindresorhus/decamelize-keys#readme","keywords":["map","object","key","keys","decamelize","decamelcase","uncamelcase","camelcase","camel-case","camel","case","separator","string","text","convert","deep","recurse","recursive"],"repository":{"url":"git+https://github.com/sindresorhus/decamelize-keys.git","type":"git"},"_npmVersion":"12.0.1","description":"Convert object keys from camel case","directories":{},"maintainers":[{"name":"sindresorhus","email":"sindresorhus@gmail.com"}],"sideEffects":false,"_nodeVersion":"26.9.0","dependencies":{"map-obj":"^4.3.0","quick-lru":"^6.1.1","type-fest":"^3.1.0","decamelize":"^6.0.0"},"_hasShrinkwrap":false,"devDependencies":{"xo":"^0.54.2","ava":"^5.0.1","tsd":"^0.24.1"},"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/decamelize-keys_2.1.0_1789919137733_0.6085822788859598"},"readme":"# decamelize-keys\n\n> Convert object keys from camel case using [`decamelize`](https://github.com/sindresorhus/decamelize)\n\n## Install\n\n```sh\nnpm install decamelize-keys\n```\n\n## Usage\n\n```js\nimport decamelizeKeys from 'decamelize-keys';\n\n// Convert an object\ndecamelizeKeys({fooBar: true});\n//=> {foo_bar: true}\n\n// Convert an array of objects\ndecamelizeKeys([{fooBar: true}, {barFoo: false}]);\n//=> [{foo_bar: true}, {bar_foo: false}]\n```\n\n## API\n\n### decamelizeKeys(input, options?)\n\n#### input\n\nType: `object | object[]`\n\nAn object or array of objects to decamelize.\n\n#### options\n\nType: `object`\n\n##### separator\n\nType: `string`\\\nDefault: `'_'`\n\nThe character or string used to separate words.\n\n```js\nimport decamelizeKeys from 'decamelize-keys';\n\ndecamelizeKeys({fooBar: true});\n//=> {foo_bar: true}\n\ndecamelizeKeys({fooBar: true}, {separator: '-'});\n//=> {'foo-bar': true}\n```\n\n##### exclude\n\nType: `Array<string | RegExp>`\\\nDefault: `[]`\n\nExclude keys from being decamelized.\n\n##### deep\n\nType: `boolean`\\\nDefault: `false`\n\nRecurse nested objects and objects in arrays.\n\n```js\nimport decamelizeKeys from 'decamelize-keys';\n\ndecamelizeKeys({fooBar: true, nested: {unicornRainbow: true}}, {deep: true});\n//=> {foo_bar: true, nested: {unicorn_rainbow: true}}\n```\n\n##### stopPaths\n\nType: `string[]`\\\nDefault: `[]`\n\nExclude children at the given object paths in dot-notation from being decamelized. This option only has an effect together with the `deep` option.\n\nThe paths use the input key casing, so for example, with an object like `{aB: {cD: '🦄'}}`, the object path to reach the unicorn is `'aB.cD'`.\n\nThe key at a stopped path is still decamelized. Only its children are left alone.\n\nFor correct TypeScript types when using this option, add `as const` to the array.\n\n```js\nimport decamelizeKeys from 'decamelize-keys';\n\nconst object = {\n\taB: 1,\n\taC: {\n\t\tcD: 1,\n\t\tcE: {\n\t\t\teF: 1\n\t\t}\n\t}\n};\n\ndecamelizeKeys(object, {\n\tdeep: true,\n\tstopPaths: [\n\t\t'aC.cE'\n\t]\n});\n/*\n{\n\ta_b: 1,\n\ta_c: {\n\t\tc_d: 1,\n\t\tc_e: {\n\t\t\teF: 1\n\t\t}\n\t}\n}\n*/\n```\n\nWhen an object is inside an array, the path is specified without array indices. A `stopPath` applies to all items in the array.\n\n```js\nimport decamelizeKeys from 'decamelize-keys';\n\nconst object = {\n\tfooBar: [\n\t\t{\n\t\t\tbarBaz: {\n\t\t\t\tquxQuux: 'value'\n\t\t\t}\n\t\t}\n\t]\n};\n\ndecamelizeKeys(object, {\n\tdeep: true,\n\tstopPaths: [\n\t\t'fooBar.barBaz'\n\t]\n});\n/*\n{\n\tfoo_bar: [\n\t\t{\n\t\t\tbar_baz: {\n\t\t\t\tquxQuux: 'value'\n\t\t\t}\n\t\t}\n\t]\n}\n*/\n```\n\n## Related\n\n- [camelcase-keys](https://github.com/sindresorhus/camelcase-keys) - The inverse of this package.\n","publish_time":1789919137803,"_cnpm_publish_time":1789919137803,"dist-tags":{"latest":"2.1.0"}}