@yuneta/gobj-js 7.26.9 → 7.26.11
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/gobj-js.cjs.js +38 -21
- package/dist/gobj-js.cjs.js.map +1 -1
- package/dist/gobj-js.cjs.min.js +154 -156
- package/dist/gobj-js.cjs.min.js.map +1 -1
- package/dist/gobj-js.es.js +38 -21
- package/dist/gobj-js.es.js.map +1 -1
- package/dist/gobj-js.es.min.js +14 -16
- package/dist/gobj-js.es.min.js.map +1 -1
- package/dist/gobj-js.iife.js +38 -21
- package/dist/gobj-js.iife.js.map +1 -1
- package/dist/gobj-js.iife.min.js +156 -158
- package/dist/gobj-js.iife.min.js.map +1 -1
- package/dist/gobj-js.umd.js +38 -21
- package/dist/gobj-js.umd.js.map +1 -1
- package/dist/gobj-js.umd.min.js +156 -158
- package/dist/gobj-js.umd.min.js.map +1 -1
- package/package.json +1 -1
package/dist/gobj-js.es.min.js
CHANGED
|
@@ -2135,6 +2135,7 @@ function Sl(e, t, n, r, l) {
|
|
|
2135
2135
|
function Nl(e, t, n, r) {
|
|
2136
2136
|
if (e && !el(e) && ir("GObj bad instanceof"), !Yr(t)) return ir("kw is not an object"), -1;
|
|
2137
2137
|
if (!Jr(n)) return ir(`${e ? $t(e) + ": " : ""}kw_set_dict_value(): path must be a string: ${String(n)}`), -1;
|
|
2138
|
+
if ("" === n) return ir((e ? $t(e) + ": " : "") + "kw_set_dict_value(): path empty"), -1;
|
|
2138
2139
|
let l = n.split("`"), o = l.length;
|
|
2139
2140
|
for (let i = 0; i < o; i++) {
|
|
2140
2141
|
let s = l[i];
|
|
@@ -2508,7 +2509,7 @@ function ro(e, t, n) {
|
|
|
2508
2509
|
yl(null, e, "hook", "data", Vn.KW_CREATE);
|
|
2509
2510
|
let l = Ol(null, e, "schema", {}, Vn.KW_CREATE), o = Ol(null, e, "topics", {}, Vn.KW_CREATE);
|
|
2510
2511
|
return no(l, function(e, t, n, l) {
|
|
2511
|
-
"__"
|
|
2512
|
+
"__" === t.substring(0, 2) || Yr(n) || Ol(null, o, l, jr(r), Vn.KW_CREATE);
|
|
2512
2513
|
}, t), e;
|
|
2513
2514
|
}
|
|
2514
2515
|
function lo(e, t, n, r) {
|
|
@@ -2516,15 +2517,17 @@ function lo(e, t, n, r) {
|
|
|
2516
2517
|
if (!l) return ir("jdb_update: topic not found: " + t), null;
|
|
2517
2518
|
if (tl(r.id)) return ir("jdb_update: record without id: " + r), _r(r), null;
|
|
2518
2519
|
if (!Jr(n)) return ir(`jdb_update: path must be a string: ${String(n)}`), null;
|
|
2519
|
-
let o, i = n.split("`"),
|
|
2520
|
-
for (; (o =
|
|
2521
|
-
if (0
|
|
2522
|
-
|
|
2520
|
+
let o, i, s = n.split("`"), a = l;
|
|
2521
|
+
for (; (o = s.shift()) && !tl(o) && a;) Yr(a) && (a = Ol(null, a, e.hook, null, 0)), a = uo(a, null, o, !1);
|
|
2522
|
+
if (!a || 0 !== s.length) return ir(`jdb_update: path not found in topic '${t}': '${n}'`), null;
|
|
2523
|
+
if (Br(a)) i = a;
|
|
2523
2524
|
else {
|
|
2524
|
-
|
|
2525
|
-
|
|
2525
|
+
if (a.id === r.id) return Dr(a, r), l;
|
|
2526
|
+
if (i = Ol(null, a, e.hook, null, 0), null == i) i = [], Lr(a, e.hook, i);
|
|
2527
|
+
else if (!Br(i)) return ir(`jdb_update: the hook '${e.hook}' of '${n}' is not a list in topic '${t}'`), null;
|
|
2526
2528
|
}
|
|
2527
|
-
|
|
2529
|
+
let u = uo(i, e.hook, r.id, !1);
|
|
2530
|
+
return u ? Dr(u, r) : i.push(r), l;
|
|
2528
2531
|
}
|
|
2529
2532
|
function oo(e, t, n, r) {
|
|
2530
2533
|
let l = Ol(null, Ol(null, e, "topics", null, 0), t, null, 0);
|
|
@@ -2533,14 +2536,9 @@ function oo(e, t, n, r) {
|
|
|
2533
2536
|
if (!Jr(n)) return ir(`jdb_delete: path must be a string: ${String(n)}`), null;
|
|
2534
2537
|
let o, i = n.split("`"), s = l;
|
|
2535
2538
|
for (; (o = i.shift()) && !tl(o) && s;) Yr(s) && (s = Ol(null, s, e.hook, null, 0)), s = uo(s, null, o, !1);
|
|
2536
|
-
if (0
|
|
2537
|
-
|
|
2538
|
-
|
|
2539
|
-
} else {
|
|
2540
|
-
let t = Ol(null, s, e.hook, null, 0), n = Kl(t, r.id);
|
|
2541
|
-
n >= 0 && t.splice(n, 1);
|
|
2542
|
-
}
|
|
2543
|
-
return l;
|
|
2539
|
+
if (!s || 0 !== i.length) return ir(`jdb_delete: path not found in topic '${t}': '${n}'`), null;
|
|
2540
|
+
let a = Br(s) ? s : Ol(null, s, e.hook, null, 0), u = Kl(a, r.id);
|
|
2541
|
+
return u < 0 ? (ir(`jdb_delete: record not found in topic '${t}': '${n}' '${r.id}'`), null) : (a.splice(u, 1), l);
|
|
2544
2542
|
}
|
|
2545
2543
|
function io(e, t) {
|
|
2546
2544
|
let n = Ol(null, e, "topics", null, 0);
|