@yuneta/gobj-js 7.26.7 → 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.
@@ -4472,9 +4472,14 @@ function kw_set_subdict_value(gobj, kw, path, key, value) {
4472
4472
  log_error("kw is not an object");
4473
4473
  return -1;
4474
4474
  }
4475
- let subdict = kw_get_dict(gobj, kw, path, {}, kw_flag_t.KW_CREATE);
4475
+ let subdict = kw_find_path(gobj, kw, path, false);
4476
+ if (subdict === void 0) {
4477
+ if (!is_string(path)) return -1;
4478
+ subdict = {};
4479
+ if (kw_set_dict_value(gobj, kw, path, subdict) < 0) return -1;
4480
+ }
4476
4481
  if (!is_object(subdict)) {
4477
- log_error("subdict is not an object");
4482
+ log_error(`subdict is not an object: '${path}'`);
4478
4483
  return -1;
4479
4484
  }
4480
4485
  set_own_key(subdict, key, value);
@@ -5221,6 +5226,10 @@ function jdb_update(jdb, topic_name, path, kw) {
5221
5226
  trace_msg(kw);
5222
5227
  return null;
5223
5228
  }
5229
+ if (!is_string(path)) {
5230
+ log_error(`jdb_update: path must be a string: ${String(path)}`);
5231
+ return null;
5232
+ }
5224
5233
  let ids = path.split("`");
5225
5234
  let id;
5226
5235
  let v = topic;
@@ -5255,6 +5264,10 @@ function jdb_delete(jdb, topic_name, path, kw) {
5255
5264
  trace_msg(kw);
5256
5265
  return null;
5257
5266
  }
5267
+ if (!is_string(path)) {
5268
+ log_error(`jdb_delete: path must be a string: ${String(path)}`);
5269
+ return null;
5270
+ }
5258
5271
  let ids = path.split("`");
5259
5272
  let id;
5260
5273
  let v = topic;