@randajan/jet-core
Advanced tools
Comparing version 3.0.6 to 3.0.7
@@ -314,2 +314,3 @@ var __defProp = Object.defineProperty; | ||
assign: () => assign, | ||
compare: () => compare, | ||
deflate: () => deflate, | ||
@@ -328,3 +329,3 @@ dig: () => dig, | ||
}); | ||
var _each = ({ create, entries, set }, any, fce, deep, dprun, dir, flat) => { | ||
var _each = ({ create, entries, set }, any, fce, deep, dprun, dir, flat, stop, isStop) => { | ||
const res = flat || create(); | ||
@@ -336,15 +337,17 @@ for (let [key, val] of entries(any)) { | ||
if (!dp) { | ||
val = fce ? fce(val, path, dir, key) : def ? def.copy(val) : val; | ||
val = fce ? fce(val, path, dir, key, stop) : def ? def.copy(val) : val; | ||
} else if (dprun) { | ||
val = deep(val, path, dir, key); | ||
val = deep(val, path, dir, key, stop); | ||
} else { | ||
val = _each(def, val, fce, deep, dprun, path, flat); | ||
val = _each(def, val, fce, deep, dprun, path, flat, stop, isStop); | ||
} | ||
if (val === void 0) { | ||
continue; | ||
if (val !== void 0) { | ||
if (!flat) { | ||
set(res, key, val); | ||
} else if (!dp) { | ||
flat.push(val); | ||
} | ||
} | ||
if (!flat) { | ||
set(res, key, val); | ||
} else if (!dp) { | ||
flat.push(val); | ||
if (isStop()) { | ||
break; | ||
} | ||
@@ -358,7 +361,8 @@ } | ||
dir = String.jet.to(dir, "."); | ||
let _stop, stop = (_) => _stop = true; | ||
if (df && df.entries) { | ||
return _each(df, any, fce, deep, defs_default.isRunnable(deep), dir, flat); | ||
return _each(df, any, fce, deep, defs_default.isRunnable(deep), dir, flat, stop, (_) => _stop); | ||
} | ||
; | ||
const val = fce ? fce(any, dir, "", dir) : df.copy ? df.copy(any) : any; | ||
const val = fce ? fce(any, dir, "", dir, stop) : df.copy ? df.copy(any) : any; | ||
if (flat && val !== void 0) { | ||
@@ -427,2 +431,5 @@ flat.push(val); | ||
forEach(any, add, includeMapable ? deep : true); | ||
if (includeMapable) { | ||
flat[""] = any; | ||
} | ||
return flat; | ||
@@ -463,2 +470,18 @@ }; | ||
var merge = (...any) => _assign(false, {}, ...any); | ||
var compare = (a, b, changeList = false) => { | ||
const res = []; | ||
if (!changeList && a === b) { | ||
return true; | ||
} | ||
const flat = deflate(a); | ||
forEach(b, (v, p, d, k, stop) => { | ||
if (flat[p] !== v) { | ||
res.push(p); | ||
} | ||
if (res.length && !changeList) { | ||
stop(); | ||
} | ||
}, true); | ||
return changeList ? res : !res.length; | ||
}; | ||
var melt = (any, comma) => { | ||
@@ -465,0 +488,0 @@ let j = "", c = String.jet.to(comma); |
{ | ||
"name": "@randajan/jet-core", | ||
"version": "3.0.6", | ||
"version": "3.0.7", | ||
"description": "Ecosystem of types and related usefull tools.", | ||
@@ -5,0 +5,0 @@ "repository": "randajan/jet-core", |
Sorry, the diff of this file is not supported yet
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
120628
1151