@yuneta/gobj-js 7.26.6 → 7.26.8
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 +23 -2
- package/dist/gobj-js.cjs.js.map +1 -1
- package/dist/gobj-js.cjs.min.js +81 -73
- package/dist/gobj-js.cjs.min.js.map +1 -1
- package/dist/gobj-js.es.js +23 -2
- package/dist/gobj-js.es.js.map +1 -1
- package/dist/gobj-js.es.min.js +79 -71
- package/dist/gobj-js.es.min.js.map +1 -1
- package/dist/gobj-js.iife.js +23 -2
- package/dist/gobj-js.iife.js.map +1 -1
- package/dist/gobj-js.iife.min.js +10 -2
- package/dist/gobj-js.iife.min.js.map +1 -1
- package/dist/gobj-js.umd.js +23 -2
- package/dist/gobj-js.umd.js.map +1 -1
- package/dist/gobj-js.umd.min.js +10 -2
- package/dist/gobj-js.umd.min.js.map +1 -1
- package/package.json +1 -1
package/dist/gobj-js.umd.js
CHANGED
|
@@ -4068,6 +4068,10 @@
|
|
|
4068
4068
|
function kw_delete(gobj, kw, path) {
|
|
4069
4069
|
if (gobj && !is_gobj(gobj)) log_error(`GObj bad instanceof`);
|
|
4070
4070
|
const prefix = gobj ? gobj_short_name(gobj) + ": " : "";
|
|
4071
|
+
if (!is_string(path)) {
|
|
4072
|
+
log_error(`${prefix}kw_delete(): path must be a string: ${String(path)}`);
|
|
4073
|
+
return -1;
|
|
4074
|
+
}
|
|
4071
4075
|
let [path_, k] = strrchr_split(path, "`");
|
|
4072
4076
|
let v = kw;
|
|
4073
4077
|
if (!empty_string(k)) {
|
|
@@ -4434,6 +4438,10 @@
|
|
|
4434
4438
|
log_error("kw is not an object");
|
|
4435
4439
|
return -1;
|
|
4436
4440
|
}
|
|
4441
|
+
if (!is_string(path)) {
|
|
4442
|
+
log_error(`${gobj ? gobj_short_name(gobj) + ": " : ""}kw_set_dict_value(): path must be a string: ${String(path)}`);
|
|
4443
|
+
return -1;
|
|
4444
|
+
}
|
|
4437
4445
|
let ss = path.split("`");
|
|
4438
4446
|
let len = ss.length;
|
|
4439
4447
|
for (let i = 0; i < len; i++) {
|
|
@@ -4468,9 +4476,14 @@
|
|
|
4468
4476
|
log_error("kw is not an object");
|
|
4469
4477
|
return -1;
|
|
4470
4478
|
}
|
|
4471
|
-
let subdict =
|
|
4479
|
+
let subdict = kw_find_path(gobj, kw, path, false);
|
|
4480
|
+
if (subdict === void 0) {
|
|
4481
|
+
if (!is_string(path)) return -1;
|
|
4482
|
+
subdict = {};
|
|
4483
|
+
if (kw_set_dict_value(gobj, kw, path, subdict) < 0) return -1;
|
|
4484
|
+
}
|
|
4472
4485
|
if (!is_object(subdict)) {
|
|
4473
|
-
log_error(
|
|
4486
|
+
log_error(`subdict is not an object: '${path}'`);
|
|
4474
4487
|
return -1;
|
|
4475
4488
|
}
|
|
4476
4489
|
set_own_key(subdict, key, value);
|
|
@@ -5217,6 +5230,10 @@
|
|
|
5217
5230
|
trace_msg(kw);
|
|
5218
5231
|
return null;
|
|
5219
5232
|
}
|
|
5233
|
+
if (!is_string(path)) {
|
|
5234
|
+
log_error(`jdb_update: path must be a string: ${String(path)}`);
|
|
5235
|
+
return null;
|
|
5236
|
+
}
|
|
5220
5237
|
let ids = path.split("`");
|
|
5221
5238
|
let id;
|
|
5222
5239
|
let v = topic;
|
|
@@ -5251,6 +5268,10 @@
|
|
|
5251
5268
|
trace_msg(kw);
|
|
5252
5269
|
return null;
|
|
5253
5270
|
}
|
|
5271
|
+
if (!is_string(path)) {
|
|
5272
|
+
log_error(`jdb_delete: path must be a string: ${String(path)}`);
|
|
5273
|
+
return null;
|
|
5274
|
+
}
|
|
5254
5275
|
let ids = path.split("`");
|
|
5255
5276
|
let id;
|
|
5256
5277
|
let v = topic;
|