@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.
@@ -1377,7 +1377,11 @@
1377
1377
  try {
1378
1378
  return JSON.stringify(e);
1379
1379
  } catch (t) {
1380
- return String(e);
1380
+ try {
1381
+ return String(e);
1382
+ } catch (t) {
1383
+ return `<${typeof e}: not printable>`;
1384
+ }
1381
1385
  }
1382
1386
  }
1383
1387
  function mn(e) {
@@ -1846,7 +1850,7 @@
1846
1850
  e && !sr(e) && hn("GObj bad instanceof");
1847
1851
  let o = mr(e, t, n, !1);
1848
1852
  const s = l && l & Zt.KW_REQUIRED, i = l && l & Zt.KW_CREATE, _ = l && l & Zt.KW_EXTRACT;
1849
- return void 0 === o ? i && Zn(r) && t ? (Sr(e, t, n, r), r) : (s && (hn(`path not found: '${n}'`), Un(t)), r) : Zn(o) ? (_ && hr(e, t, n), o) : (s && (hn(`${e ? et(e) + ": " : ""}path MUST BE a json dict: '${n}'`), Un(t)), r);
1853
+ return void 0 === o ? i && Zn(r) && t ? (Sr(e, t, n, r), r) : (s && (hn(`path not found: '${n}'`), Un(t)), r) : Zn(o) ? (_ && hr(e, t, n), o) : i && null === o && Zn(r) ? (Sr(e, t, n, r), r) : ((s || i) && (hn(`${e ? et(e) + ": " : ""}path MUST BE a json dict: '${n}'` + (i ? ", cannot create" : "")), Un(t)), r);
1850
1854
  }
1851
1855
  function Or(e, t, n, r, l) {
1852
1856
  e && !sr(e) && hn("GObj bad instanceof");
@@ -3185,7 +3189,7 @@
3185
3189
  }, e.is_secret_name = wn, e.is_string = tr, e.jdb_delete = function(e, t, n, r) {
3186
3190
  let l = Or(null, Or(null, e, "topics", null, 0), t, null, 0);
3187
3191
  if (!l) return hn("jdb_delete: topic not found: " + t), null;
3188
- if (!Zn(r) || ir(r.id)) return hn(`jdb_delete: record without id: ${JSON.stringify(r)}`), null;
3192
+ if (!Zn(r) || ir(r.id)) return hn(`jdb_delete: record without id: ${pn(r)}`), null;
3189
3193
  if (!tr(n)) return hn(`jdb_delete: path must be a string: ${String(n)}`), null;
3190
3194
  if ("" !== n && n.split("`").includes("")) return hn(`jdb_delete: empty segment in path: '${n}'`), null;
3191
3195
  let o, s = n.split("`"), i = l;
@@ -3214,7 +3218,7 @@
3214
3218
  }, e.jdb_update = function(e, t, n, r) {
3215
3219
  let l = Or(null, Or(null, e, "topics", null, 0), t, null, 0);
3216
3220
  if (!l) return hn("jdb_update: topic not found: " + t), null;
3217
- if (!Zn(r) || ir(r.id)) return hn(`jdb_update: record without id: ${JSON.stringify(r)}`), null;
3221
+ if (!Zn(r) || ir(r.id)) return hn(`jdb_update: record without id: ${pn(r)}`), null;
3218
3222
  if (!tr(n)) return hn(`jdb_update: path must be a string: ${String(n)}`), null;
3219
3223
  if ("" !== n && n.split("`").includes("")) return hn(`jdb_update: empty segment in path: '${n}'`), null;
3220
3224
  let o, s, i = n.split("`"), _ = l;
@@ -3283,7 +3287,7 @@
3283
3287
  e && !sr(e) && hn("GObj bad instanceof");
3284
3288
  let o = mr(e, t, n, !1);
3285
3289
  const s = l && l & Zt.KW_REQUIRED, i = l && l & Zt.KW_CREATE, _ = l && l & Zt.KW_EXTRACT;
3286
- return void 0 === o ? i && er(r) && t ? (Sr(e, t, n, r), r) : (s && (hn(`path not found: '${n}'`), Un(t)), r) : er(o) ? (_ && hr(e, t, n), o) : (s && (hn(`${e ? et(e) + ": " : ""}path MUST BE a json list: '${n}'`), Un(t)), r);
3290
+ return void 0 === o ? i && er(r) && t ? (Sr(e, t, n, r), r) : (s && (hn(`path not found: '${n}'`), Un(t)), r) : er(o) ? (_ && hr(e, t, n), o) : i && null === o && er(r) ? (Sr(e, t, n, r), r) : ((s || i) && (hn(`${e ? et(e) + ": " : ""}path MUST BE a json list: '${n}'` + (i ? ", cannot create" : "")), Un(t)), r);
3287
3291
  }, e.kw_get_local_storage_value = kr, e.kw_get_pointer = vr, e.kw_get_real = function(e, t, n, r, l) {
3288
3292
  e && !sr(e) && hn("GObj bad instanceof");
3289
3293
  let o = mr(e, t, n, !1);