@yuneta/gobj-js 7.26.5 → 7.26.7

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.
@@ -1753,17 +1753,15 @@ function br(e, t, n, r) {
1753
1753
  }
1754
1754
  function mr(e, t, n) {
1755
1755
  e && !sr(e) && mn("GObj bad instanceof");
1756
- let [r, o] = function(e, t) {
1756
+ const r = e ? Ze(e) + ": " : "";
1757
+ if (!er(n)) return mn(`${r}kw_delete(): path must be a string: ${String(n)}`), -1;
1758
+ let [o, s] = function(e, t) {
1757
1759
  let n = e.lastIndexOf(t);
1758
1760
  return -1 === n ? [e, ""] : [e.substring(0, n), e.substring(n + 1)];
1759
- }(n, "`");
1760
- if (lr(o)) Wn(t, n);
1761
- else {
1762
- let s = br(e, t, r, !0);
1763
- if (Zn(s)) return mn(`${e ? Ze(e) + ": " : ""}kw_delete(): cannot delete an item of a list: '${n}'`), -1;
1764
- Wn(s, o);
1765
- }
1766
- return 0;
1761
+ }(n, "`"), l = t;
1762
+ if (lr(s)) s = n;
1763
+ else if (l = br(e, t, o, !0), void 0 === l) return -1;
1764
+ return Zn(l) ? (mn(`${r}kw_delete(): cannot delete an item of a list: '${n}'`), -1) : Xn(l) && Object.prototype.hasOwnProperty.call(l, s) ? (delete l[s], 0) : (mn(`${r}kw_delete(): path not found: '${n}'`), -1);
1767
1765
  }
1768
1766
  function hr(e, t, n, r, o) {
1769
1767
  e && !sr(e) && mn("GObj bad instanceof");
@@ -1862,6 +1860,7 @@ function jr(e, t, n, r, o) {
1862
1860
  }
1863
1861
  function Or(e, t, n, r) {
1864
1862
  if (e && !sr(e) && mn("GObj bad instanceof"), !Xn(t)) return mn("kw is not an object"), -1;
1863
+ if (!er(n)) return mn(`${e ? Ze(e) + ": " : ""}kw_set_dict_value(): path must be a string: ${String(n)}`), -1;
1865
1864
  let o = n.split("`"), s = o.length;
1866
1865
  for (let l = 0; l < s; l++) {
1867
1866
  let i = o[l];