@danielsimonjr/memoryjs 1.3.0 → 1.4.0

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.
package/dist/index.cjs CHANGED
@@ -11257,15 +11257,16 @@ var SchemaValidator = class {
11257
11257
  * Get field path from AJV error.
11258
11258
  */
11259
11259
  getFieldPath(error) {
11260
+ const instancePath = error.instancePath || "";
11260
11261
  if (error.params?.missingProperty) {
11261
- const basePath = error.instancePath.replace(/^\//, "").replace(/\//g, ".");
11262
+ const basePath = instancePath.replace(/^\//, "").replace(/\//g, ".");
11262
11263
  return basePath ? `${basePath}.${error.params.missingProperty}` : error.params.missingProperty;
11263
11264
  }
11264
11265
  if (error.params?.additionalProperty) {
11265
- const basePath = error.instancePath.replace(/^\//, "").replace(/\//g, ".");
11266
+ const basePath = instancePath.replace(/^\//, "").replace(/\//g, ".");
11266
11267
  return basePath ? `${basePath}.${error.params.additionalProperty}` : error.params.additionalProperty;
11267
11268
  }
11268
- return error.instancePath.replace(/^\//, "").replace(/\//g, ".") || "root";
11269
+ return instancePath.replace(/^\//, "").replace(/\//g, ".") || "root";
11269
11270
  }
11270
11271
  /**
11271
11272
  * Get human-readable error message.