@yuneta/gobj-js 7.26.6 → 7.26.7

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.
@@ -4064,6 +4064,10 @@ function strrchr_split(str, char) {
4064
4064
  function kw_delete(gobj, kw, path) {
4065
4065
  if (gobj && !is_gobj(gobj)) log_error(`GObj bad instanceof`);
4066
4066
  const prefix = gobj ? gobj_short_name(gobj) + ": " : "";
4067
+ if (!is_string(path)) {
4068
+ log_error(`${prefix}kw_delete(): path must be a string: ${String(path)}`);
4069
+ return -1;
4070
+ }
4067
4071
  let [path_, k] = strrchr_split(path, "`");
4068
4072
  let v = kw;
4069
4073
  if (!empty_string(k)) {
@@ -4430,6 +4434,10 @@ function kw_set_dict_value(gobj, kw, path, value) {
4430
4434
  log_error("kw is not an object");
4431
4435
  return -1;
4432
4436
  }
4437
+ if (!is_string(path)) {
4438
+ log_error(`${gobj ? gobj_short_name(gobj) + ": " : ""}kw_set_dict_value(): path must be a string: ${String(path)}`);
4439
+ return -1;
4440
+ }
4433
4441
  let ss = path.split("`");
4434
4442
  let len = ss.length;
4435
4443
  for (let i = 0; i < len; i++) {