Comparing version 1.6.4 to 1.6.5
@@ -985,21 +985,8 @@ 'use strict'; | ||
const replace = []; | ||
const isRefString = (val) => | ||
typeof val === 'string' && val.startsWith(flag); | ||
const slice = (v) => v.slice(flag.length); | ||
const isRefStr = (v) => typeof v === 'string' && v.startsWith(flag); | ||
function _reviver(key, value) { | ||
let isRef = false; | ||
if (flag) { | ||
if (isRefString(value)) { | ||
isRef = true; | ||
let ref = value.slice(flag.length); | ||
replace.unshift(() => { | ||
let refValue = refs[ref]; | ||
while (isRefString(refValue)) { | ||
refValue = refs[refValue.slice(flag.length)]; | ||
} | ||
this[key] = refValue; | ||
}); | ||
} | ||
if (!map.has(this)) { | ||
map.set(this, {}); | ||
} | ||
if (!map.has(this)) map.set(this, {}); | ||
const parent = map.get(this); | ||
@@ -1018,2 +1005,13 @@ parent[key] = { | ||
parent[key].add(key); | ||
if (isRefStr(value)) { | ||
isRef = true; | ||
let ref = slice(value); | ||
replace.unshift(() => { | ||
let refValue = refs[ref]; | ||
while (isRefStr(refValue)) { | ||
refValue = refs[slice(refValue)]; | ||
} | ||
this[key] = refValue; | ||
}); | ||
} | ||
} | ||
@@ -1020,0 +1018,0 @@ return !isRef && typeof reviver === 'function' |
@@ -983,21 +983,8 @@ export { Queue } from 'small-queue'; | ||
const replace = []; | ||
const isRefString = (val) => | ||
typeof val === 'string' && val.startsWith(flag); | ||
const slice = (v) => v.slice(flag.length); | ||
const isRefStr = (v) => typeof v === 'string' && v.startsWith(flag); | ||
function _reviver(key, value) { | ||
let isRef = false; | ||
if (flag) { | ||
if (isRefString(value)) { | ||
isRef = true; | ||
let ref = value.slice(flag.length); | ||
replace.unshift(() => { | ||
let refValue = refs[ref]; | ||
while (isRefString(refValue)) { | ||
refValue = refs[refValue.slice(flag.length)]; | ||
} | ||
this[key] = refValue; | ||
}); | ||
} | ||
if (!map.has(this)) { | ||
map.set(this, {}); | ||
} | ||
if (!map.has(this)) map.set(this, {}); | ||
const parent = map.get(this); | ||
@@ -1016,2 +1003,13 @@ parent[key] = { | ||
parent[key].add(key); | ||
if (isRefStr(value)) { | ||
isRef = true; | ||
let ref = slice(value); | ||
replace.unshift(() => { | ||
let refValue = refs[ref]; | ||
while (isRefStr(refValue)) { | ||
refValue = refs[slice(refValue)]; | ||
} | ||
this[key] = refValue; | ||
}); | ||
} | ||
} | ||
@@ -1018,0 +1016,0 @@ return !isRef && typeof reviver === 'function' |
@@ -1044,21 +1044,8 @@ (function (global, factory) { | ||
const replace = []; | ||
const isRefString = (val) => | ||
typeof val === 'string' && val.startsWith(flag); | ||
const slice = (v) => v.slice(flag.length); | ||
const isRefStr = (v) => typeof v === 'string' && v.startsWith(flag); | ||
function _reviver(key, value) { | ||
let isRef = false; | ||
if (flag) { | ||
if (isRefString(value)) { | ||
isRef = true; | ||
let ref = value.slice(flag.length); | ||
replace.unshift(() => { | ||
let refValue = refs[ref]; | ||
while (isRefString(refValue)) { | ||
refValue = refs[refValue.slice(flag.length)]; | ||
} | ||
this[key] = refValue; | ||
}); | ||
} | ||
if (!map.has(this)) { | ||
map.set(this, {}); | ||
} | ||
if (!map.has(this)) map.set(this, {}); | ||
const parent = map.get(this); | ||
@@ -1077,2 +1064,13 @@ parent[key] = { | ||
parent[key].add(key); | ||
if (isRefStr(value)) { | ||
isRef = true; | ||
let ref = slice(value); | ||
replace.unshift(() => { | ||
let refValue = refs[ref]; | ||
while (isRefStr(refValue)) { | ||
refValue = refs[slice(refValue)]; | ||
} | ||
this[key] = refValue; | ||
}); | ||
} | ||
} | ||
@@ -1079,0 +1077,0 @@ return !isRef && typeof reviver === 'function' |
{ | ||
"name": "aidly", | ||
"version": "1.6.4", | ||
"version": "1.6.5", | ||
"description": "Tool library.", | ||
@@ -5,0 +5,0 @@ "sideEffects": false, |
Sorry, the diff of this file is not supported yet
259027
8302