@jarenjs/validate 0.46.4 → 0.49.2
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/docs/ERROR-MESSAGES.md +10 -0
- package/package.json +3 -3
package/docs/ERROR-MESSAGES.md
CHANGED
|
@@ -73,8 +73,18 @@ One flat namespace:
|
|
|
73
73
|
| query runtime via `$query` | the `JQ2xxx` code (`JQ2001`, `JQ2003`, ...) | `{ code, docPath }` |
|
|
74
74
|
| forms field checks | `form/` + the emitted keyword: `form/required`, `form/type`, `form/const`, `form/enum`, `form/minLength`, `form/maxLength`, `form/pattern`, `form/format`, `form/minimum`, `form/maximum`, `form/exclusiveMinimum`, `form/exclusiveMaximum`, `form/multipleOf`, `form/minItems`, `form/maxItems`, `form/uniqueItems`, `form/minProperties`, `form/maxProperties` | per branch: `limit`, `len`, `type`, `format`, `enumValues`, `constValue`, `pattern`, `multipleOf` |
|
|
75
75
|
| forms rules | `x-form/assert` (the default), else the author's `$msgid` | `{ pointer, ...spec.params }` |
|
|
76
|
+
| calendar language | `date/month/01`…`12` and `date/weekday/0`…`6`, each `/wide` and `/short`; `date/meridiem/am|pm`; `date/relative/<unit>/past|future` over `second`…`year`; `date/relative/{now,yesterday,today,tomorrow}`; `format/name/<format>` | names take none; a relative entry takes the ABSOLUTE `{ value }` |
|
|
76
77
|
| applications | any `$msgid` they invent — recommend dotted names (`checkout.total-too-low`) | error params + spec params |
|
|
77
78
|
|
|
79
|
+
The calendar family is data rather than a failure: `@jarenjs/core/dates`
|
|
80
|
+
is locale-free, so its `MMMM`/`EEE`/`a` tokens need a names provider, and
|
|
81
|
+
`@jarenjs/locales`' `compileDateLocale` reads that family into one.
|
|
82
|
+
`format/name/<format>` is the one entry a message *resolves through*: the
|
|
83
|
+
forms layer swaps a format's wire name for the catalog's display name
|
|
84
|
+
before rendering `form/format`, leaving `params.format` structural so the
|
|
85
|
+
same error re-renders in a second language. See the
|
|
86
|
+
[`@jarenjs/locales` README](../../locales/README.md).
|
|
87
|
+
|
|
78
88
|
Keywords without a built-in English entry (`const`, `enum`,
|
|
79
89
|
`dependentRequired`, `dependencies`, `unevaluatedProperties`, ...) render
|
|
80
90
|
the generic `validation failed for keyword '<keyword>'`; their `msgid` is
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@jarenjs/validate",
|
|
3
3
|
"private": false,
|
|
4
|
-
"version": "0.
|
|
4
|
+
"version": "0.49.2",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "./src/index.js",
|
|
7
7
|
"types": "./dist/types/index.d.ts",
|
|
@@ -55,7 +55,7 @@
|
|
|
55
55
|
"prepack": "npm run build:types"
|
|
56
56
|
},
|
|
57
57
|
"dependencies": {
|
|
58
|
-
"@jarenjs/core": "^0.
|
|
59
|
-
"@jarenjs/json": "^0.
|
|
58
|
+
"@jarenjs/core": "^0.49.2",
|
|
59
|
+
"@jarenjs/json": "^0.49.2"
|
|
60
60
|
}
|
|
61
61
|
}
|