Skip to content

Commit

Permalink
Use while loop
Browse files Browse the repository at this point in the history
  • Loading branch information
rohit2sharma95 committed Oct 26, 2021
1 parent 6515792 commit fd89f97
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/index.js
@@ -1,7 +1,7 @@
export function dset(obj, keys, val) {
keys.split && (keys=keys.split('.'));
var i=0, l=keys.length, t=obj, x, k;
for (; i < l;) {
while (i < l) {
k = keys[i++];
if (k === '__proto__' || k === 'constructor' || k === 'prototype') break;
t = t[k] = (i === l) ? val : (typeof(x=t[k])===typeof(keys)) ? x : (keys[i]*0 !== 0 || !!~(''+keys[i]).indexOf('.')) ? {} : [];
Expand Down

0 comments on commit fd89f97

Please sign in to comment.