@yuneta/gobj-js 7.26.11 → 7.26.13

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.
@@ -4444,6 +4444,10 @@ var gobjJs = (function(exports) {
4444
4444
  log_error(`${gobj ? gobj_short_name(gobj) + ": " : ""}kw_set_dict_value(): path empty`);
4445
4445
  return -1;
4446
4446
  }
4447
+ if (path.split("`").includes("")) {
4448
+ log_error(`${gobj ? gobj_short_name(gobj) + ": " : ""}kw_set_dict_value(): empty segment in path: '${path}'`);
4449
+ return -1;
4450
+ }
4447
4451
  let ss = path.split("`");
4448
4452
  let len = ss.length;
4449
4453
  for (let i = 0; i < len; i++) {
@@ -5247,15 +5251,18 @@ var gobjJs = (function(exports) {
5247
5251
  log_error("jdb_update: topic not found: " + topic_name);
5248
5252
  return null;
5249
5253
  }
5250
- if (empty_string(kw["id"])) {
5251
- log_error("jdb_update: record without id: " + kw);
5252
- trace_msg(kw);
5254
+ if (!is_object(kw) || empty_string(kw["id"])) {
5255
+ log_error(`jdb_update: record without id: ${JSON.stringify(kw)}`);
5253
5256
  return null;
5254
5257
  }
5255
5258
  if (!is_string(path)) {
5256
5259
  log_error(`jdb_update: path must be a string: ${String(path)}`);
5257
5260
  return null;
5258
5261
  }
5262
+ if (path !== "" && path.split("`").includes("")) {
5263
+ log_error(`jdb_update: empty segment in path: '${path}'`);
5264
+ return null;
5265
+ }
5259
5266
  let ids = path.split("`");
5260
5267
  let id;
5261
5268
  let v = topic;
@@ -5297,15 +5304,18 @@ var gobjJs = (function(exports) {
5297
5304
  log_error("jdb_delete: topic not found: " + topic_name);
5298
5305
  return null;
5299
5306
  }
5300
- if (empty_string(kw["id"])) {
5301
- log_error("jdb_delete: record without id: " + kw);
5302
- trace_msg(kw);
5307
+ if (!is_object(kw) || empty_string(kw["id"])) {
5308
+ log_error(`jdb_delete: record without id: ${JSON.stringify(kw)}`);
5303
5309
  return null;
5304
5310
  }
5305
5311
  if (!is_string(path)) {
5306
5312
  log_error(`jdb_delete: path must be a string: ${String(path)}`);
5307
5313
  return null;
5308
5314
  }
5315
+ if (path !== "" && path.split("`").includes("")) {
5316
+ log_error(`jdb_delete: empty segment in path: '${path}'`);
5317
+ return null;
5318
+ }
5309
5319
  let ids = path.split("`");
5310
5320
  let id;
5311
5321
  let v = topic;