nestify-anything
Advanced tools
Comparing version 2.0.2 to 2.0.3
@@ -18,9 +18,12 @@ import { merge } from 'merge-anything'; | ||
const result = {}; | ||
const matches = path.match(/[^.]+/g) || []; | ||
matches.reduce((carry, _prop, index, array) => { | ||
_prop = _prop.replace('_____dot_____', '.'); | ||
const container = index === array.length - 1 ? newValue : {}; | ||
carry[_prop] = container; | ||
return container; | ||
}, result); | ||
const matches = Array.from(path.matchAll(/[^.]+/g), ([x]) => x); | ||
let point = result; | ||
let index = 0; | ||
for (const _prop of matches) { | ||
const prop = _prop.replace(/_____dot_____/g, '.'); | ||
const isLast = index++ === matches.length - 1; | ||
const container = isLast ? newValue : {}; | ||
point[prop] = container; | ||
point = container; | ||
} | ||
return result; | ||
@@ -27,0 +30,0 @@ } |
@@ -0,0 +0,0 @@ /** |
@@ -5,3 +5,3 @@ { | ||
"type": "module", | ||
"version": "2.0.2", | ||
"version": "2.0.3", | ||
"description": "Recreates an object from any `nested.props`. A simple and small integration.", | ||
@@ -27,21 +27,21 @@ "module": "./dist/index.es.js", | ||
"lint": "tsc --noEmit && eslint ./src --ext .ts", | ||
"build": "rollup -c ./scripts/build.js", | ||
"build": "rollup --bundleConfigAsCjs -c ./scripts/build.js", | ||
"release": "npm run lint && del dist && npm run build && np" | ||
}, | ||
"dependencies": { | ||
"merge-anything": "^4.0.5" | ||
"merge-anything": "^5.1.5" | ||
}, | ||
"devDependencies": { | ||
"@typescript-eslint/eslint-plugin": "^5.10.1", | ||
"@typescript-eslint/parser": "^5.10.1", | ||
"del-cli": "^4.0.1", | ||
"eslint": "^8.7.0", | ||
"eslint-config-prettier": "^8.3.0", | ||
"@typescript-eslint/eslint-plugin": "^5.59.0", | ||
"@typescript-eslint/parser": "^5.59.0", | ||
"del-cli": "^5.0.0", | ||
"eslint": "^8.39.0", | ||
"eslint-config-prettier": "^8.8.0", | ||
"eslint-plugin-tree-shaking": "^1.10.0", | ||
"np": "^7.6.0", | ||
"prettier": "^2.5.1", | ||
"rollup": "^2.66.1", | ||
"rollup-plugin-typescript2": "^0.31.1", | ||
"typescript": "^4.5.5", | ||
"vitest": "^0.2.3" | ||
"np": "^7.7.0", | ||
"prettier": "^2.8.8", | ||
"rollup": "^3.21.0", | ||
"rollup-plugin-typescript2": "^0.34.1", | ||
"typescript": "^5.0.4", | ||
"vitest": "^0.30.1" | ||
}, | ||
@@ -48,0 +48,0 @@ "keywords": [ |
@@ -14,11 +14,16 @@ # Nestify anything 🧅 | ||
## Meet the family | ||
## Meet the family (more tiny utils with TS support) | ||
- [flatten-anything 🏏](https://github.com/mesqueeb/flatten-anything) | ||
- [is-what 🙉](https://github.com/mesqueeb/is-what) | ||
- [is-where 🙈](https://github.com/mesqueeb/is-where) | ||
- [merge-anything 🥡](https://github.com/mesqueeb/merge-anything) | ||
- [check-anything 👁](https://github.com/mesqueeb/check-anything) | ||
- [remove-anything ✂️](https://github.com/mesqueeb/remove-anything) | ||
- [getorset-anything 🐊](https://github.com/mesqueeb/getorset-anything) | ||
- [map-anything 🗺](https://github.com/mesqueeb/map-anything) | ||
- [filter-anything ⚔️](https://github.com/mesqueeb/filter-anything) | ||
- [find-and-replace-anything 🎣](https://github.com/mesqueeb/find-and-replace-anything) | ||
- [compare-anything 🛰](https://github.com/mesqueeb/compare-anything) | ||
- [copy-anything 🎭](https://github.com/mesqueeb/copy-anything) | ||
- [is-what 🙉](https://github.com/mesqueeb/is-what) | ||
- [case-anything 🐫](https://github.com/mesqueeb/case-anything) | ||
- [flatten-anything 🏏](https://github.com/mesqueeb/flatten-anything) | ||
- [nestify-anything 🧅](https://github.com/mesqueeb/nestify-anything) | ||
@@ -25,0 +30,0 @@ ## Usage |
Sorry, the diff of this file is not supported yet
9602
111
48
+ Addedis-what@4.1.16(transitive)
+ Addedmerge-anything@5.1.7(transitive)
- Removedis-what@3.14.1(transitive)
- Removedmerge-anything@4.0.5(transitive)
- Removedts-toolbelt@9.6.0(transitive)
Updatedmerge-anything@^5.1.5