Skip to content

Commit

Permalink
Merge c892ba6 into 9dd5e9f
Browse files Browse the repository at this point in the history
  • Loading branch information
spautz committed Jan 10, 2021
2 parents 9dd5e9f + c892ba6 commit 6e14252
Show file tree
Hide file tree
Showing 4 changed files with 664 additions and 550 deletions.
2 changes: 1 addition & 1 deletion .nvmrc
@@ -1 +1 @@
14.15.0
14.15.4
14 changes: 7 additions & 7 deletions package.json
Expand Up @@ -68,16 +68,16 @@
"dependencies": {},
"devDependencies": {
"@ngard/tiny-get": "1.2.2",
"@types/jest": "26.0.15",
"@types/node": "14.14.6",
"@types/jest": "26.0.20",
"@types/node": "14.14.20",
"coveralls": "3.1.0",
"husky": "4.3.0",
"lint-staged": "10.5.1",
"husky": "4.3.7",
"lint-staged": "10.5.3",
"rimraf": "3.0.2",
"standard-version": "9.0.0",
"standard-version": "9.1.0",
"tsdx": "0.14.1",
"tslib": "2.0.3",
"typescript": "3.9.7",
"tslib": "2.1.0",
"typescript": "4.1.3",
"yarn-or-npm": "3.0.1"
},
"lint-staged": {
Expand Down
2 changes: 1 addition & 1 deletion src/index.ts
Expand Up @@ -14,7 +14,7 @@ const set = <T = ObjectOrArray>(
): T => {
const newRoot: any = clone(root);

if (path in newRoot || typeof path === 'number') {
if (typeof path === 'number' || (!isArray(path) && path in newRoot)) {
// Just set it directly: no need to loop
newRoot[path as string] = newValue;
return newRoot;
Expand Down

0 comments on commit 6e14252

Please sign in to comment.