Skip to content

Commit fa0f75c

Browse files
chore: use while loop (#29)
1 parent 6515792 commit fa0f75c

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/index.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
export function dset(obj, keys, val) {
22
keys.split && (keys=keys.split('.'));
33
var i=0, l=keys.length, t=obj, x, k;
4-
for (; i < l;) {
4+
while (i < l) {
55
k = keys[i++];
66
if (k === '__proto__' || k === 'constructor' || k === 'prototype') break;
77
t = t[k] = (i === l) ? val : (typeof(x=t[k])===typeof(keys)) ? x : (keys[i]*0 !== 0 || !!~(''+keys[i]).indexOf('.')) ? {} : [];

0 commit comments

Comments
 (0)