@yuneta/gobj-js 7.26.13 → 7.26.15

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.
@@ -1574,7 +1574,11 @@ function lr(e) {
1574
1574
  try {
1575
1575
  return JSON.stringify(e);
1576
1576
  } catch (t) {
1577
- return String(e);
1577
+ try {
1578
+ return String(e);
1579
+ } catch (t) {
1580
+ return `<${typeof e}: not printable>`;
1581
+ }
1578
1582
  }
1579
1583
  }
1580
1584
  function or(e) {
@@ -2111,7 +2115,7 @@ function vl(e, t, n, r, l) {
2111
2115
  e && !el(e) && ir("GObj bad instanceof");
2112
2116
  let o = bl(e, t, n, !1);
2113
2117
  const i = l && l & Vn.KW_REQUIRED, s = l && l & Vn.KW_CREATE, a = l && l & Vn.KW_EXTRACT;
2114
- return void 0 === o ? s && Yr(r) && t ? (Nl(e, t, n, r), r) : (i && (ir(`path not found: '${n}'`), wr(t)), r) : Yr(o) ? (a && pl(e, t, n), o) : (i && (ir(`${e ? Rt(e) + ": " : ""}path MUST BE a json dict: '${n}'`), wr(t)), r);
2118
+ return void 0 === o ? s && Yr(r) && t ? (Nl(e, t, n, r), r) : (i && (ir(`path not found: '${n}'`), wr(t)), r) : Yr(o) ? (a && pl(e, t, n), o) : s && null === o && Yr(r) ? (Nl(e, t, n, r), r) : ((i || s) && (ir(`${e ? Rt(e) + ": " : ""}path MUST BE a json dict: '${n}'` + (s ? ", cannot create" : "")), wr(t)), r);
2115
2119
  }
2116
2120
  function Ol(e, t, n, r, l) {
2117
2121
  e && !el(e) && ir("GObj bad instanceof");
@@ -2130,7 +2134,7 @@ function Sl(e, t, n, r, l) {
2130
2134
  e && !el(e) && ir("GObj bad instanceof");
2131
2135
  let o = bl(e, t, n, !1);
2132
2136
  const i = l && l & Vn.KW_REQUIRED, s = l && l & Vn.KW_CREATE, a = l && l & Vn.KW_EXTRACT;
2133
- return void 0 === o ? s && Br(r) && t ? (Nl(e, t, n, r), r) : (i && (ir(`path not found: '${n}'`), wr(t)), r) : Br(o) ? (a && pl(e, t, n), o) : (i && (ir(`${e ? Rt(e) + ": " : ""}path MUST BE a json list: '${n}'`), wr(t)), r);
2137
+ return void 0 === o ? s && Br(r) && t ? (Nl(e, t, n, r), r) : (i && (ir(`path not found: '${n}'`), wr(t)), r) : Br(o) ? (a && pl(e, t, n), o) : s && null === o && Br(r) ? (Nl(e, t, n, r), r) : ((i || s) && (ir(`${e ? Rt(e) + ": " : ""}path MUST BE a json list: '${n}'` + (s ? ", cannot create" : "")), wr(t)), r);
2134
2138
  }
2135
2139
  function Nl(e, t, n, r) {
2136
2140
  if (e && !el(e) && ir("GObj bad instanceof"), !Yr(t)) return ir("kw is not an object"), -1;
@@ -2516,7 +2520,7 @@ function ro(e, t, n) {
2516
2520
  function lo(e, t, n, r) {
2517
2521
  let l = Ol(null, Ol(null, e, "topics", null, 0), t, null, 0);
2518
2522
  if (!l) return ir("jdb_update: topic not found: " + t), null;
2519
- if (!Yr(r) || tl(r.id)) return ir(`jdb_update: record without id: ${JSON.stringify(r)}`), null;
2523
+ if (!Yr(r) || tl(r.id)) return ir(`jdb_update: record without id: ${lr(r)}`), null;
2520
2524
  if (!Jr(n)) return ir(`jdb_update: path must be a string: ${String(n)}`), null;
2521
2525
  if ("" !== n && n.split("`").includes("")) return ir(`jdb_update: empty segment in path: '${n}'`), null;
2522
2526
  let o, i, s = n.split("`"), a = l;
@@ -2534,7 +2538,7 @@ function lo(e, t, n, r) {
2534
2538
  function oo(e, t, n, r) {
2535
2539
  let l = Ol(null, Ol(null, e, "topics", null, 0), t, null, 0);
2536
2540
  if (!l) return ir("jdb_delete: topic not found: " + t), null;
2537
- if (!Yr(r) || tl(r.id)) return ir(`jdb_delete: record without id: ${JSON.stringify(r)}`), null;
2541
+ if (!Yr(r) || tl(r.id)) return ir(`jdb_delete: record without id: ${lr(r)}`), null;
2538
2542
  if (!Jr(n)) return ir(`jdb_delete: path must be a string: ${String(n)}`), null;
2539
2543
  if ("" !== n && n.split("`").includes("")) return ir(`jdb_delete: empty segment in path: '${n}'`), null;
2540
2544
  let o, i = n.split("`"), s = l;