{"_id":"@alizeait/unflatto","_rev":"5-8771a833edf617e10652a65ecb5a710b","name":"@alizeait/unflatto","dist-tags":{"latest":"1.0.3"},"versions":{"1.0.0":{"name":"@alizeait/unflatto","version":"1.0.0","keywords":["object","array","nested","flat","unflatten","expand","nest","seperator","fast","tiny","small"],"author":{"name":"Ali Zeaiter","email":"rassoali.arz@gmail.com"},"license":"MIT","_id":"@alizeait/unflatto@1.0.0","maintainers":[{"name":"alizeait","email":"ali.zeaiter@volvocars.com"}],"homepage":"https://github.com/alizeait/unflatto#readme","bugs":{"url":"https://github.com/alizeait/unflatto/issues"},"dist":{"shasum":"c29ccaaa3bc61bcb2eb0e23816ca1f52cf98e40d","tarball":"https://registry.npmjs.org/@alizeait/unflatto/-/unflatto-1.0.0.tgz","fileCount":12,"integrity":"sha512-EKyPmCvAQ1bvnyd2L6a5Uw0fzLKv3az4Ka4UNUbQpsgudhsfuNW7nC0hKfHvjK1smQId/luhNvP0Ha+pnr5Oxg==","signatures":[{"sig":"MEQCIGs5tViEspHnq5E6LJ1Wrvs2k1+HrAQk6gFKV+pBe41SAiAcrFRWEZquvJdGi9UkSmKynfcGnsfpyElWoRtJGrgcEw==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":13696,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgDLfLCRA9TVsSAnZWagAAvyYP/1lC+87BrXIoZmK6Dtz3\npQUnSiJ5s1XPbMkwh6try2E66pecyyzVr9UgBk4TgQexaHYlpVmG5QZvBAYf\nfdzsdb33QDsAGc5Tbt8WAHuc3hYAahn8AVZAZd6fhZR42C06ysZoP7ReK/5D\nL7ieJGK7FeejAE8jImwhM5Grcsn4jLMC0ipgKmdek3pyG1Qent0TRW+de3U+\ng76EdJ2OFYB48kC/b8G1KBCDM0vAmMSPSRiXPm6VjBDue6u1KDtCm5KNleD3\n+wOGzxS+V6H3i8dSFxDYP7oVVUToGDPw0Ac8PzqVfzf8TYnSfEKcGnWgeSnR\nTk2g+31oo4fBPLyqj58ySWI/98K+SkUXqpNd66PdozzG1rBVC5SPT9K/zC9x\nBL2ojPdNjph5tiGdMZgbOXYultf0Cm7vj/MrsquMfLZOn533AhSR08XYkkuL\noBSZ+TpupGMfQHUN1FHSbQjqySSm/jynCWWxS91zvoOrM+Kc6Xd6/qZS208j\np9WFx3K7HXs7KpX2F2XJ1NGt4GOPZ1NOy/UrNwgU8IYVK2ZR9VihJe8qF7rI\nJJkNWLRIG0MPoEdwgYaOF7av2KU6x7kxIx5aqdYOgpVl9XZn9A8PECRVbYaJ\n1MzvreTm/gfM4cfcmKfsIwHpaSgb+R4I2wi0F37wzX85aJRkZCTWHgSU+QCk\n2cbI\r\n=7zSs\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/index.js","types":"dist/index.d.ts","unpkg":"dist/index.umd.js","module":"dist/index.module.js","browser":"dist/index.modern.js","exports":{".":{"import":"./dist/index.js","browser":"./dist/index.modern.js","require":"./dist/index.js"},"./":"./","./package.json":"./package.json"},"gitHead":"3054aa7d35ee25995daa61c872014be19ae089c4","scripts":{"dev":"microbundle watch","lint":"eslint","test":"npx jest","build":"microbundle"},"_npmUser":{"name":"alizeait","email":"ali.zeaiter@volvocars.com"},"repository":{"url":"git+https://github.com/alizeait/unflatto.git","type":"git"},"_npmVersion":"6.12.0","description":"A tiny (~210B) and fast flattened object expander, unflattener","directories":{},"_nodeVersion":"12.13.0","_hasShrinkwrap":false,"devDependencies":{"flat":"^5.0.2","jest":"^26.6.3","eslint":"^7.18.0","codecov":"^3.8.1","ts-jest":"^26.4.4","benchmark":"^2.1.4","typescript":"^4.1.3","@types/jest":"^26.0.20","microbundle":"^0.13.0","obj-unflatten":"^1.0.10","@typescript-eslint/parser":"^4.14.0","@typescript-eslint/eslint-plugin":"^4.14.0"},"_npmOperationalInternal":{"tmp":"tmp/unflatto_1.0.0_1611446218992_0.49009303092539747","host":"s3://npm-registry-packages"}},"1.0.1":{"name":"@alizeait/unflatto","version":"1.0.1","keywords":["object","array","nested","flat","unflatten","expand","nest","seperator","fast","tiny","small"],"author":{"name":"Ali Zeaiter","email":"rassoali.arz@gmail.com"},"license":"MIT","_id":"@alizeait/unflatto@1.0.1","maintainers":[{"name":"alizeait","email":"rassoali.arz@gmail.com"}],"homepage":"https://github.com/alizeait/unflatto#readme","bugs":{"url":"https://github.com/alizeait/unflatto/issues"},"dist":{"shasum":"b8cec54f7a1b375bb4f0a3d8035d619a67359068","tarball":"https://registry.npmjs.org/@alizeait/unflatto/-/unflatto-1.0.1.tgz","fileCount":10,"integrity":"sha512-yzFK6YkCm8hBJIw3o6GhlsizNYN+BqmRy9gvJal8y/v0Ur5uoLSuhPE8HSoCiLhaROzxjR3MRiUWsJM9Mo00PQ==","signatures":[{"sig":"MEYCIQDpvOCy/i4HNUmEexJM+S6KaUyfURfm2BtDR3MuzEJkBQIhAO4QmR2IvyQHHbzTWxvk21CtUqKPwquU0xgFGPLX0iPZ","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":11727,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJj2G0YACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2Vmr1jA/+NN9WCWq/oUQcuF83UCXRplt3mGkwgNZuZXXc8FlYPuNFadNi\r\nY/X506hgZSNzDFtxbTAZnuoAtgy5mlry857jy8MMA3ewBdelGfHVlo0qTSsE\r\nPpeQpLdaptOzOQe2c6oupURwZhrdNpCdoMRBGTPUBvoMN/TXXJ49jajXrcUT\r\n9/XcRvetGTqZQHlFbHhFPHTT5OGPH2XCUTk/OT7rzMFjF3bITY3n78qkEmgG\r\nKwhCr1qafxWc5ky5XgQTuLjoPiiT07twxuBS/xdqw75PD9FcZ8KBzZk+XD1f\r\n1WjFGQ0bGjZteNoKyuR0S/CHV+AYdOx8A0zu1V06vH91uAlJVfzq4M7yHRwh\r\n79o+Ln+78FoObXbV9mNQrcPUnPql4v1XXiSJ+zjD/70Zxon5SqXj+j/Zd51C\r\nKOSBG4uba7uaGfWRcryoJQLOO0zqJcVqCP97bfyBT6jiENxgb+9OxpaKzttn\r\nBrbWeeNjlOq/L+5PDTYuiM6xrCzJDK690BBIME15t2apZJ31y8+ootBI3/dm\r\nCfwLwNPvXKO4B8Szlx9jtp9VCDwvUP0mqh7Mbkst6FoxtMF3G8wVv87++FcQ\r\nfDKm6CghwV9xo6xieVNq+hhnXXcfQ1CidFhgJqi8VEppjIW7wtX3wAcaplOK\r\nD993sNXWF8R73v/b/3TFEGcozXOusFb1cZQ=\r\n=K+nK\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/index.js","types":"dist/index.d.ts","unpkg":"dist/index.umd.js","module":"dist/index.module.js","browser":"dist/index.modern.js","exports":{".":{"import":"./dist/index.js","browser":"./dist/index.modern.js","require":"./dist/index.js"},"./":"./","./package.json":"./package.json"},"gitHead":"eb55d04c28ddb90b4fed503e1512e321899b7967","scripts":{"dev":"microbundle watch","lint":"eslint","test":"npx jest","build":"microbundle"},"_npmUser":{"name":"alizeait","email":"rassoali.arz@gmail.com"},"repository":{"url":"git+https://github.com/alizeait/unflatto.git","type":"git"},"_npmVersion":"8.11.0","description":"A tiny (~210B) and fast flattened object expander, unflattener","directories":{},"_nodeVersion":"16.15.1","_hasShrinkwrap":false,"devDependencies":{"flat":"^5.0.2","jest":"^26.6.3","eslint":"^7.18.0","codecov":"^3.8.1","ts-jest":"^26.4.4","benchmark":"^2.1.4","typescript":"^4.1.3","@types/jest":"^26.0.20","microbundle":"^0.13.0","obj-unflatten":"^1.0.10","@typescript-eslint/parser":"^4.14.0","@typescript-eslint/eslint-plugin":"^4.14.0"},"_npmOperationalInternal":{"tmp":"tmp/unflatto_1.0.1_1675128088088_0.475812105131153","host":"s3://npm-registry-packages"}},"1.0.2":{"name":"@alizeait/unflatto","version":"1.0.2","keywords":["object","array","nested","flat","unflatten","expand","nest","seperator","fast","tiny","small"],"author":{"name":"Ali Zeaiter","email":"rassoali.arz@gmail.com"},"license":"MIT","_id":"@alizeait/unflatto@1.0.2","maintainers":[{"name":"alizeait","email":"rassoali.arz@gmail.com"}],"homepage":"https://github.com/alizeait/unflatto#readme","bugs":{"url":"https://github.com/alizeait/unflatto/issues"},"dist":{"shasum":"bd268a3fe7aef81170f20099a124c8f8e7606a28","tarball":"https://registry.npmjs.org/@alizeait/unflatto/-/unflatto-1.0.2.tgz","fileCount":8,"integrity":"sha512-p6EBalJqdfnVWaq3pQEmycOk+R0JC1IHy8q7LwWyuQM6cJr5BWeKihSiTbPP7Y7Y0yH6eY7Vgba92GJthvfKlg==","signatures":[{"sig":"MEUCIQD8IgLsBpHpYw3olBhhIzh4dfypXYi8jCpg+MvgK5BsSAIgGkLVXHESt9hnzrYr/0cCmV8R7Q+h5X0YcXTjhRMpjMo=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":9136,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJj4sk9ACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmpskA//RgtSXZLO90i8j0/xnS4zb+zZwma/w5vQb6PSeCs5jyLxd7us\r\nrOQ4XgDLRiMiSlpzDwXJNcdMqxdRQWk+P4GdxRiKVsRuFNkOZnlpteCXgtQj\r\nc8CigjA4b51LAWK6yrMoMGP6lQ0lY0zqSIAyx5bzwCtA3FlTXhy9/3mCyYwo\r\ngo0FP6C5ItkrjAETS1f6yU6JB0SErO7nnoyxF1mb7sMWbuy0LHeewSKAMAsG\r\nefrYLOm/Kruq4Nvnsk1F/jgSLAnisWVg2XjmsPtZYI9nc0OQ2qDGuhRZQvVZ\r\nquJaDZ4RMdtVTdrUfI3aCosLy5euQPGx2c6AhhW9Hsih8CMEttX+QckBDOhF\r\n3wU9HP4/7Kyc0vOV30DuhiPV+z97H00/bnHUbsdZML7KuD3/dNCtzyAcexMR\r\n1bsPf7IcVYWV3azYuox4cRql2M7c7YfB82P6YfcvaNkIJR4eYz4TPDfj5lL1\r\ngSLZYGnF2sSKeHpw995dFXbFEDuI3Fy2UwIw40oLVLfX1yhH8K0J92hYDQRo\r\nXBZh2gFs0QBqZydkodksqbxwYwFvaOMuRYOxh2BKx7HPe/Mk6mi4Wf84l1V4\r\nEidy4EuDazLLKTsEu3o8WmZBXJFrxghtyXMfDQSHuN/GS40xUp/StA5VINBq\r\neL/sLvq0n/IiGedHWTUIpWGBUipwFgCieq4=\r\n=CrZ+\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/index.js","types":"dist/index.d.ts","module":"dist/index.modern.js","gitHead":"24ddf03ff92505a15e0f8edd28e56de24d0a317f","scripts":{"dev":"microbundle watch","lint":"eslint","test":"npx jest","build":"microbundle -f modern,cjs"},"_npmUser":{"name":"alizeait","email":"rassoali.arz@gmail.com"},"repository":{"url":"git+https://github.com/alizeait/unflatto.git","type":"git"},"_npmVersion":"8.11.0","description":"A tiny (~210B) and fast flattened object expander, unflattener","directories":{},"_nodeVersion":"16.15.1","_hasShrinkwrap":false,"devDependencies":{"flat":"^5.0.2","jest":"^26.6.3","eslint":"^7.18.0","codecov":"^3.8.1","ts-jest":"^26.4.4","benchmark":"^2.1.4","typescript":"^4.1.3","@types/jest":"^26.0.20","microbundle":"^0.13.0","obj-unflatten":"^1.0.10","@typescript-eslint/parser":"^4.14.0","@typescript-eslint/eslint-plugin":"^4.14.0"},"_npmOperationalInternal":{"tmp":"tmp/unflatto_1.0.2_1675807036998_0.4520128683024702","host":"s3://npm-registry-packages"}},"1.0.3":{"name":"@alizeait/unflatto","version":"1.0.3","description":"A tiny (~210B) and fast flattened object expander, unflattener","scripts":{"build":"microbundle -f modern,cjs","dev":"microbundle watch","test":"jest","lint":"eslint"},"main":"dist/index.js","module":"dist/index.modern.js","types":"dist/index.d.ts","repository":{"type":"git","url":"git+https://github.com/alizeait/unflatto.git"},"keywords":["object","array","nested","flat","unflatten","expand","nest","seperator","fast","tiny","small"],"author":{"name":"Ali Zeaiter","email":"rassoali.arz@gmail.com"},"license":"MIT","bugs":{"url":"https://github.com/alizeait/unflatto/issues"},"homepage":"https://github.com/alizeait/unflatto#readme","devDependencies":{"@types/jest":"^26.0.20","@typescript-eslint/eslint-plugin":"^4.14.0","@typescript-eslint/parser":"^4.14.0","benchmark":"^2.1.4","codecov":"^3.8.1","eslint":"^7.18.0","flat":"^5.0.2","jest":"^29.7.0","microbundle":"0.15.1","obj-unflatten":"^1.0.10","ts-jest":"^29.3.1","typescript":"^4.1.3"},"_id":"@alizeait/unflatto@1.0.3","gitHead":"4b2627cf5f0162cfb4dbac2938691c5ba62818e5","_nodeVersion":"22.12.0","_npmVersion":"10.9.0","dist":{"integrity":"sha512-uyjzjoXcKDUrNEMEwP0hTr5EGba3sKLqPghY4RQ0XMh05jT54ZtS1x379AwPMDcfDmOJqV6Om1xatav8ucz28w==","shasum":"b82cd2ea2ee43d29b6181028a6307942ff54927b","tarball":"https://registry.npmjs.org/@alizeait/unflatto/-/unflatto-1.0.3.tgz","fileCount":10,"unpackedSize":11883,"signatures":[{"keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U","sig":"MEQCIDx+Y7IDc0MRkuWz89yEYudxs3kdIfJ15GVXGHhARDnnAiAAo4VCXb4l+MmpgYqeng10u/oD2PPxe/Rgq7uLy+RwTg=="}]},"_npmUser":{"name":"alizeait","email":"rassoali.arz@gmail.com"},"directories":{},"maintainers":[{"name":"alizeait","email":"rassoali.arz@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/unflatto_1.0.3_1743495762954_0.002819230728885902"},"_hasShrinkwrap":false}},"time":{"created":"2021-01-23T23:56:58.956Z","modified":"2025-04-01T08:22:43.292Z","1.0.0":"2021-01-23T23:56:59.171Z","1.0.1":"2023-01-31T01:21:28.289Z","1.0.2":"2023-02-07T21:57:17.192Z","1.0.3":"2025-04-01T08:22:43.140Z"},"bugs":{"url":"https://github.com/alizeait/unflatto/issues"},"author":{"name":"Ali Zeaiter","email":"rassoali.arz@gmail.com"},"license":"MIT","homepage":"https://github.com/alizeait/unflatto#readme","keywords":["object","array","nested","flat","unflatten","expand","nest","seperator","fast","tiny","small"],"repository":{"type":"git","url":"git+https://github.com/alizeait/unflatto.git"},"description":"A tiny (~210B) and fast flattened object expander, unflattener","maintainers":[{"name":"alizeait","email":"rassoali.arz@gmail.com"}],"readme":"# @alizeait/unflatto ![Check](https://github.com/alizeait/unflatto/workflows/Check/badge.svg) ![Coverage](https://img.shields.io/codecov/c/github/alizeait/unflatto)\r\n\r\n> A tiny (~210B) and [fast](#benchmarks) flattened object expander, unflattener\r\n\r\nTakes an already flattened object and returns a new nested object by expanding the keys.\r\n\r\nIt assumes the keys are seperated by a `.` by default but this can be changed to anything with the seperator option.\r\n\r\n## Installation\r\n\r\n```bash\r\n$ npm install @alizeait/unflatto\r\n```\r\n\r\n## Usage\r\n\r\n```js\r\nimport { unflatto } from \"@alizeait/unflatto\";\r\n\r\nconst unflattened = unflatto(\r\n{\r\n  \"key1.keyA\": \"valueI\",\r\n  \"key2.keyB\": \"valueII\",\r\n  \"key3.a.b.c\": 2,\r\n  \"key4\": [],\r\n  \"key5.a.0\": \"value1\",\r\n  \"key5.a.1\": \"value2\",\r\n  \"key5.a.2.key1.keyA\": \"valueI\",\r\n  \"key5.a.2.key1.keyB.0\": 1,\r\n  \"key5.a.2.key1.keyB.1\": 2,\r\n  \"key5.a.2.key1.keyB.2\": 3,\r\n  \"key5.a.2.key1.keyB.3\": 4,\r\n  \"key5.b\": null,\r\n  \"key5.c\": undefined,\r\n  \"key6\": {}\r\n}\r\n\r\n/*\r\n{\r\n  key1: {\r\n    keyA: \"valueI\",\r\n  },\r\n  key2: {\r\n    keyB: \"valueII\",\r\n  },\r\n  key3: { a: { b: { c: 2 } } },\r\n  key4: [],\r\n  key5: {\r\n    a: [\r\n      \"value1\",\r\n      \"value2\",\r\n      {\r\n        key1: {\r\n          keyA: \"valueI\",\r\n          keyB: [1, 2, 3, 4],\r\n        },\r\n      },\r\n    ],\r\n    b: null,\r\n    c: undefined,\r\n  },\r\n  key6: {},\r\n});\r\n  */\r\n\r\nconst unflattoCustom = unflatto({\r\n  \"key1-keyA\": \"valueI\",\r\n  \"key2-keyB\": \"valueII\",\r\n  \"key3-a-b-c\": 2,\r\n},\"-\");\r\n\r\n/*\r\n  {\r\n    key1: {\r\n      keyA: \"valueI\",\r\n    },\r\n    key2: {\r\n      keyB: \"valueII\",\r\n    },\r\n    key3: { a: { b: { c: 2 } } },\r\n  }\r\n*/\r\n```\r\n\r\n## Benchmarks\r\n\r\n```\r\nBenchmarks:\r\n\r\n  flat.unflatten               x 63,827 ops/sec ±0.95% (89 runs sampled)\r\n  @alizeait/unflatto           x 208,279 ops/sec ±0.84% (93 runs sampled)\r\n  obj-unflatten                x 168,569 ops/sec ±0.68% (92 runs sampled)\r\n```\r\n\r\n> Running on Node.js v12.13.0, 64-bit OS, Intel(R) Core(TM) i5-6600K CPU @ 3.50GHz, 16.0 GB RAM\r\n\r\n## Validation\r\n\r\n```\r\nValidation:\r\n\r\nflat.unflatten               ✔\r\n@alizeait/unflatto           ✔\r\nobj-unflatten                ✘\r\n  Wrongly expands arrays\r\n```\r\n\r\n## API\r\n\r\n### unflatto(input: Object, seperator?:string)\r\n\r\nReturns: `Object` | `Array`\r\n\r\nReturns a new expanded object/array.\r\n","readmeFilename":"README.md"}