Comparing version 21.2.1 to 21.2.2
37
json.js
@@ -65,11 +65,9 @@ | ||
exports.ext = { | ||
num: function(str, dec) { | ||
toNum: function(str, dec) { | ||
var out = typeof str === "string" ? parseFloat( | ||
dec ? | ||
str.replace(dec, "\ufdff").replace(/[^-e\d\ufdff]/g, "").replace("\ufdff", ".") : | ||
str.replace(/[^-e\d.]/g, "") | ||
str.replace(dec || ".", "\ufdff").replace(/[^-e\d\ufdff]/g, "").replace("\ufdff", ".") | ||
) : NaN | ||
return out === out ? out : null | ||
}, | ||
date: Date.parse | ||
toDate: Date.parse | ||
} | ||
@@ -147,5 +145,5 @@ | ||
v = ( | ||
sub ? | ||
pathGet(0, path, 0, 0, 0, 0, 1) + (arr ? "i" : "j") + "(o)&&" + v + ( | ||
arrExt ? "f(o,m(" + quote(sub[0]) + ")" + ( | ||
sub || arrExt ? | ||
pathGet(0, path, 0, 0, 0, 0, 1) + (arr || arr === "" ? "i" : "j") + "(o)&&" + v + ( | ||
arrExt ? "f(o," + (sub ? "m(" + quote(sub[0]) + ")" : "1") + ( | ||
arrSup ? (arrExt === "*" ? ",p(" : ",r(") + quote(arrSup) + "))" : ")" | ||
@@ -174,4 +172,4 @@ ) : | ||
, sub = arr || obj | ||
if (sub) { | ||
out = "(o=" + (arr ? "i(" : "j(") + op + ")?" + op + ":(" + op + (arr ? "=[]" : "={}") +"))&&" | ||
if (sub || arrExt) { | ||
out = "(o=" + (arr || arr === "" ? "i(" : "j(") + op + ")?" + op + ":(" + op + (arr || arr === "" ? "=[]" : "={}") +"))&&" | ||
if (arr === "-") { | ||
@@ -183,3 +181,3 @@ op = "o[o.length]" | ||
op = "o[p(" + quote(sub.slice(1)) + ")(d)]" | ||
} else { | ||
} else if (!arrExt) { | ||
if (!onlyFilterRe.test(arr)) throw Error(FILTER_ERR + str) | ||
@@ -190,3 +188,6 @@ op = "o[t]" | ||
} | ||
return out + (dot ? | ||
return out + ( | ||
arrExt ? | ||
"(c=f(o," + (sub ? "m(" + quote(sub) + ")" : 1) + (arrSup ? ",p(" + quote(arrSup) + ",true),v))" : ",0,v))") : | ||
dot ? | ||
"(o=typeof " + op + "==='object'&&" + op + "||(" + op + "={}))&&" : | ||
@@ -406,3 +407,3 @@ "((c=" + op + "),(" + op + "=v),c)" | ||
function filterObj(a, match, get) { | ||
function filterObj(a, match, get, val) { | ||
var out = [] | ||
@@ -412,8 +413,10 @@ , i = -1 | ||
if (isObject(a)) { | ||
for (i in a) if (hasOwn.call(a, i) && match(a[i])) { | ||
out.push(get ? get(a[i]) : a[i]) | ||
for (i in a) if (hasOwn.call(a, i) && (match === 1 || match(a[i]))) { | ||
out.push(get ? get(a[i], val) : a[i]) | ||
if (get === 0) a[i] = val | ||
} | ||
} else { | ||
for (; ++i < len; ) if (match(a[i])) { | ||
out.push(get ? get(a[i]) : a[i]) | ||
for (; ++i < len; ) if (match === 1 || match(a[i])) { | ||
out.push(get ? get(a[i], val) : a[i]) | ||
if (get === 0) a[i] = val | ||
} | ||
@@ -420,0 +423,0 @@ } |
{ | ||
"name": "litejs", | ||
"version": "21.2.1", | ||
"version": "21.2.2", | ||
"description": "Full-stack web framework in a tiny package", | ||
@@ -5,0 +5,0 @@ "license": "MIT", |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
71248
2330