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