@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.
@@ -4476,9 +4476,14 @@
4476
4476
  log_error("kw is not an object");
4477
4477
  return -1;
4478
4478
  }
4479
- let subdict = kw_get_dict(gobj, kw, path, {}, kw_flag_t.KW_CREATE);
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
+ }
4480
4485
  if (!is_object(subdict)) {
4481
- log_error("subdict is not an object");
4486
+ log_error(`subdict is not an object: '${path}'`);
4482
4487
  return -1;
4483
4488
  }
4484
4489
  set_own_key(subdict, key, value);
@@ -5225,6 +5230,10 @@
5225
5230
  trace_msg(kw);
5226
5231
  return null;
5227
5232
  }
5233
+ if (!is_string(path)) {
5234
+ log_error(`jdb_update: path must be a string: ${String(path)}`);
5235
+ return null;
5236
+ }
5228
5237
  let ids = path.split("`");
5229
5238
  let id;
5230
5239
  let v = topic;
@@ -5259,6 +5268,10 @@
5259
5268
  trace_msg(kw);
5260
5269
  return null;
5261
5270
  }
5271
+ if (!is_string(path)) {
5272
+ log_error(`jdb_delete: path must be a string: ${String(path)}`);
5273
+ return null;
5274
+ }
5262
5275
  let ids = path.split("`");
5263
5276
  let id;
5264
5277
  let v = topic;