@ditojs/server 1.2.0 → 1.2.1

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ditojs/server",
3
- "version": "1.2.0",
3
+ "version": "1.2.1",
4
4
  "type": "module",
5
5
  "description": "Dito.js Server – Dito.js is a declarative and modern web framework, based on Objection.js, Koa.js and Vue.js",
6
6
  "repository": "https://github.com/ditojs/dito/tree/master/packages/server",
@@ -82,5 +82,5 @@
82
82
  "pg": "^8.7.3",
83
83
  "sqlite3": "^5.0.2"
84
84
  },
85
- "gitHead": "ac257e83630a7387e161116ba6fa4dd46db2985f"
85
+ "gitHead": "14339419ebec275f8e611092d399acff706b9322"
86
86
  }
@@ -195,12 +195,12 @@ export class Validator extends objection.Validator {
195
195
  // NOTE: As of Ajv 8, `error.dataPath` is now called `error.instancePath`,
196
196
  // but we stick to `error.dataPath` in Dito.js, and support both in errors
197
197
  // passed in here.
198
- const instancePath = error.instancePath || error.dataPath
198
+ const instancePath = (error.instancePath ?? error.dataPath) || ''
199
199
  const dataPath = `${options?.dataPath || ''}${instancePath}`
200
200
  // Unknown properties are reported in `['propertyName']` notation,
201
201
  // so replace those with dot-notation, see:
202
202
  // https://github.com/epoberezkin/ajv/issues/671
203
- const key = dataPath.replace(/\['([^']*)'\]/g, '.$1').slice(1)
203
+ const key = dataPath.replace(/\['([^']*)'\]/g, '/$1').slice(1)
204
204
  const { message, keyword, params } = error
205
205
  const definition = keyword === 'format'
206
206
  ? this.getFormat(params.format)