{"versions":{"1.1.0":{"name":"flattie","version":"1.1.0","repository":{"type":"git","url":"git+https://github.com/lukeed/flattie.git"},"description":"A tiny (203B) and fast utility to flatten an object with customizable glue","unpkg":"dist/index.min.js","module":"dist/index.mjs","main":"dist/index.js","types":"index.d.ts","license":"MIT","author":{"name":"Luke Edwards","email":"luke.edwards05@gmail.com","url":"https://lukeed.com"},"exports":{".":{"import":"./dist/index.mjs","require":"./dist/index.js"},"./package.json":"./package.json"},"engines":{"node":">=8"},"scripts":{"build":"bundt","bench":"node bench","test":"uvu -r esm test"},"keywords":["keys","flatten","object","nested","flat"],"devDependencies":{"bundt":"1.1.1","esm":"3.2.25","uvu":"0.3.3"},"gitHead":"bc2182d9e43a305b82783e4d78485ca6cd246edf","bugs":{"url":"https://github.com/lukeed/flattie/issues"},"homepage":"https://github.com/lukeed/flattie#readme","_id":"flattie@1.1.0","_npmVersion":"6.4.1","_nodeVersion":"10.13.0","_npmUser":{"name":"anonymous","email":"luke@lukeed.com"},"dist":{"shasum":"1459504209f2001c478751b4e2fb69d6b1ee3241","size":3064,"noattachment":false,"tarball":"http://123.232.10.234:8212/nexus/content/groups/npm-public/flattie/-/flattie-1.1.0.tgz","integrity":"sha512-xU99gDEnciIwJdGcBmNHnzTJ/w5AT+VFJOu6sTB6WM8diOYNA3Sa+K1DiEBQ7XH4QikQq3iFW1U+jRVcotQnBw=="},"maintainers":[{"name":"anonymous","email":"luke@lukeed.com"}],"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/flattie_1.1.0_1599675956250_0.8860156111403861"},"_hasShrinkwrap":false,"publish_time":1599675956532,"_cnpm_publish_time":1599675956532,"_cnpmcore_publish_time":"2021-12-17T03:00:06.428Z","contributors":[]},"1.0.0":{"name":"flattie","version":"1.0.0","repository":{"type":"git","url":"git+https://github.com/lukeed/flattie.git"},"description":"A tiny (187B) and fast utility to flatten an object with customizable glue","unpkg":"dist/index.min.js","module":"dist/index.mjs","main":"dist/index.js","types":"index.d.ts","license":"MIT","author":{"name":"Luke Edwards","email":"luke.edwards05@gmail.com","url":"https://lukeed.com"},"exports":{".":{"import":"./dist/index.mjs","require":"./dist/index.js"},"./package.json":"./package.json"},"engines":{"node":">=8"},"scripts":{"build":"bundt","bench":"node bench","test":"uvu -r esm test"},"keywords":["keys","flatten","object","nested","flat"],"devDependencies":{"bundt":"1.1.1","esm":"3.2.25","uvu":"0.3.3"},"gitHead":"833b3aa8431dce804f0f7ad61ae44a1a6cbf34a0","bugs":{"url":"https://github.com/lukeed/flattie/issues"},"homepage":"https://github.com/lukeed/flattie#readme","_id":"flattie@1.0.0","_npmVersion":"6.4.1","_nodeVersion":"10.13.0","_npmUser":{"name":"anonymous","email":"luke@lukeed.com"},"dist":{"shasum":"7adf9ef5a67641c85f6587174c69588f3659936c","size":2860,"noattachment":false,"tarball":"http://123.232.10.234:8212/nexus/content/groups/npm-public/flattie/-/flattie-1.0.0.tgz","integrity":"sha512-74Kv8cuMPu5e3pz2tzom3VDxi7iVsWPHstSOzOO7nfP9fXnlCTzqhuQrvKjJG/LPWrvcEQGvG0ZeDgG+IEsmlg=="},"maintainers":[{"name":"anonymous","email":"luke@lukeed.com"}],"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/flattie_1.0.0_1599587433036_0.31852142430752606"},"_hasShrinkwrap":false,"publish_time":1599587433160,"_cnpm_publish_time":1599587433160,"_cnpmcore_publish_time":"2021-12-17T03:00:06.685Z","contributors":[]},"0.0.0":{"name":"flattie","version":"0.0.0","repository":{"type":"git","url":"git+https://github.com/lukeed/flattie.git"},"description":"A tiny (188B) utility to flatten an object with customizable glue","unpkg":"dist/index.min.js","module":"dist/index.mjs","main":"dist/index.js","types":"index.d.ts","license":"MIT","author":{"name":"Luke Edwards","email":"luke.edwards05@gmail.com","url":"https://lukeed.com"},"exports":{".":{"import":"./dist/index.mjs","require":"./dist/index.js"},"./package.json":"./package.json"},"engines":{"node":">= 4"},"scripts":{"build":"bundt","bench":"node bench","test":"uvu -r esm test"},"keywords":["flatten","object","nested","flat"],"devDependencies":{"bundt":"1.1.1","esm":"3.2.25","uvu":"0.3.3"},"gitHead":"be2cf643703f36cb2788f11d289345c04cbc22de","bugs":{"url":"https://github.com/lukeed/flattie/issues"},"homepage":"https://github.com/lukeed/flattie#readme","_id":"flattie@0.0.0","_nodeVersion":"12.18.3","_npmVersion":"6.14.6","dist":{"shasum":"972c05fbc6788cbb79bd6f185a270db169c8c701","size":2791,"noattachment":false,"tarball":"http://123.232.10.234:8212/nexus/content/groups/npm-public/flattie/-/flattie-0.0.0.tgz","integrity":"sha512-D+RTDvO8ZRk1MCcUYPlj03knYg1Fik9M5h4wWYsH19MPLpBgoC3FiQvH1h5CMd8gke0ONOhewNGcNBGeVGw9/Q=="},"maintainers":[{"name":"anonymous","email":"luke@lukeed.com"}],"_npmUser":{"name":"anonymous","email":"luke@lukeed.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/flattie_0.0.0_1599577705320_0.4299519430475929"},"_hasShrinkwrap":false,"publish_time":1599577705426,"_cnpm_publish_time":1599577705426,"_cnpmcore_publish_time":"2021-12-17T03:00:07.158Z","contributors":[]},"1.1.1":{"name":"flattie","version":"1.1.1","repository":{"type":"git","url":"git+https://github.com/lukeed/flattie.git"},"description":"A tiny (203B) and fast utility to flatten an object with customizable glue","unpkg":"dist/index.min.js","module":"dist/index.mjs","main":"dist/index.js","types":"index.d.ts","license":"MIT","author":{"name":"Luke Edwards","email":"luke.edwards05@gmail.com","url":"https://lukeed.com"},"exports":{".":{"types":"./index.d.ts","import":"./dist/index.mjs","require":"./dist/index.js"},"./package.json":"./package.json"},"engines":{"node":">=8"},"scripts":{"build":"bundt","bench":"node bench","test":"uvu -r esm test"},"keywords":["keys","flatten","object","nested","flat"],"devDependencies":{"bundt":"1.1.1","esm":"3.2.25","uvu":"0.3.3"},"_id":"flattie@1.1.1","gitHead":"6bc22feb9674d8b39d7d3e01d5d711f4c5342ed5","bugs":{"url":"https://github.com/lukeed/flattie/issues"},"homepage":"https://github.com/lukeed/flattie#readme","_nodeVersion":"20.11.0","_npmVersion":"10.2.4","dist":{"integrity":"sha512-9UbaD6XdAL97+k/n+N7JwX46K/M6Zc6KcFYskrYL8wbBV/Uyk0CTAMY0VT+qiK5PM7AIc9aTWYtq65U7T+aCNQ==","shasum":"88182235723113667d36217fec55359275d6fe3d","tarball":"http://123.232.10.234:8212/nexus/content/groups/npm-public/flattie/-/flattie-1.1.1.tgz","fileCount":7,"unpackedSize":6956,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQCg+l4lJZMH2KjM8eExAqu+fdpAWwlNIf363SDB0SsQkgIga6YLm8HLUT33q73w0yZ6GIgeLK8+FMjY5spm/FyoPNs="}],"size":3139},"_npmUser":{"name":"anonymous","email":"luke@lukeed.com"},"directories":{},"maintainers":[{"name":"anonymous","email":"luke@lukeed.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/flattie_1.1.1_1709762118207_0.8563250523845107"},"_hasShrinkwrap":false,"_cnpmcore_publish_time":"2024-03-06T21:55:18.360Z","publish_time":1709762118360,"_source_registry_name":"default","contributors":[]}},"dist-tags":{"latest":"1.1.1"},"name":"flattie","time":{"created":"2022-01-27T08:15:20.717Z","modified":"2024-03-06T21:58:54.496Z","1.1.0":"2020-09-09T18:25:56.532Z","1.0.0":"2020-09-08T17:50:33.160Z","0.0.0":"2020-09-08T15:08:25.426Z","1.1.1":"2024-03-06T21:55:18.360Z"},"readme":"# flattie [![CI](https://github.com/lukeed/flattie/workflows/CI/badge.svg)](https://github.com/lukeed/flattie/actions) [![codecov](https://badgen.now.sh/codecov/c/github/lukeed/flattie)](https://codecov.io/gh/lukeed/flattie)\n\n> A tiny (203B) and [fast](#benchmarks) utility to flatten an object with customizable glue\n\nThis module recursively squashes an Object/Array. The output is a flat object – AKA, it has a single level of depth.\n\nBy default, the `.` character is used to glue/join layers' keys together. This is customizable.\n\nFinally, by default, any keys with nullish values (`null` and `undefined`) are **not** included in the return object.\n\n## Install\n\n```\n$ npm install --save flattie\n```\n\n\n## Usage\n\n```js\nimport { flattie } from 'flattie';\n\nflattie({\n  a: 'hi',\n  b: {\n    a: null,\n    b: ['foo', '', null, 'bar'],\n    d: 'hello',\n    e: {\n      a: 'yo',\n      b: undefined,\n      c: 'sup',\n      d: 0,\n      f: [\n        { foo: 123, bar: 123 },\n        { foo: 465, bar: 456 },\n      ]\n    }\n  },\n  c: 'world'\n});\n// {\n//   'a': 'hi',\n//   'b.b.0': 'foo',\n//   'b.b.1': '',\n//   'b.b.3': 'bar',\n//   'b.d': 'hello',\n//   'b.e.a': 'yo',\n//   'b.e.c': 'sup',\n//   'b.e.d': 0,\n//   'b.e.f.0.foo': 123,\n//   'b.e.f.0.bar': 123,\n//   'b.e.f.1.foo': 465,\n//   'b.e.f.1.bar': 456,\n//   'c': 'world'\n// }\n```\n\n> **Note:** `null` and `undefined` values are purged by default.\n\n## API\n\n### flattie(input, glue?, keepNullish?)\nReturns: `Object`\n\nReturns a new object with a single level of depth.\n\n> **Important:** An object is always returned despite `input` type.\n\n#### input\nType: `Object|Array`\n\nThe object to flatten.\n\n#### glue\nType: `String`<br>\nDefault: `.`\n\nA string used to join parent key names to nested child key names.\n\n```js\nconst foo = { bar: 123 };\n\nflattie({ foo }); //=> { 'foo.bar': 123 }\nflattie({ foo }, '???'); //=> { 'foo???bar': 123 }\n```\n\n#### keepNullish\nType: `Boolean`<br>\nDefault: `false`\n\nWhether or not `null` and `undefined` values should be kept.\n\n```js\n// Note: Applies to Objects too\nconst foo = ['hello', null, NaN, undefined, /*hole*/, 'world'];\n\nflattie({ foo });\n//=> {\n//=>   'foo.0': 'hello',\n//=>   'foo.2': NaN,\n//=>   'foo.5': 'world'\n//=> }\n\nflattie({ foo }, '.', true);\n//=> {\n//=>   'foo.0': 'hello',\n//=>   'foo.1': null,\n//=>   'foo.2': NaN,\n//=>   'foo.3': undefined,\n//=>   'foo.4': undefined,\n//=>   'foo.5': 'world'\n//=> }\n```\n\n## Benchmarks\n\n> Running on Node.js v10.13.0\n\n```\nLoad Time:\n  flat             1.047ms\n  flatten-object   1.239ms\n  flat-obj         0.997ms\n  flattie          0.258ms\n\nValidation:\n  ✔ flat\n  ✔ flatten-object\n  ✔ flat-obj\n  ✔ flattie\n\nBenchmark:\n  flat               x 186,487 ops/sec ±1.28% (86 runs sampled)\n  flatten-object     x 199,476 ops/sec ±1.01% (93 runs sampled)\n  flat-obj           x 393,574 ops/sec ±1.41% (95 runs sampled)\n  flattie            x 909,734 ops/sec ±0.82% (93 runs sampled)\n```\n\n\n## Related\n\n* [nestie](https://github.com/lukeed/nestie) – A tiny (242B) and fast utility to expand a flattened object <br>_This is `flattie`'s reverse / counterpart._\n\n\n## License\n\nMIT © [Luke Edwards](https://lukeed.com)","users":{}}