Skip to content

Commit 82de5e6

Browse files
author
Sascha Goldhofer
committed
release: bump version to v9.0.2
1 parent d3008e4 commit 82de5e6

File tree

3 files changed

+6
-6
lines changed

3 files changed

+6
-6
lines changed

dist/jsonSchemaLibrary.js

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dist/module/lib/validation/format.js

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ const isValidURITemplate = /^(?:(?:[^\x00-\x20"'<>%\\^`{|}]|%[0-9a-f]{2})|\{[+#.
1919
// Default Json-Schema formats: date-time, email, hostname, ipv4, ipv6, uri, uriref
2020
const formatValidators = {
2121
date: (draft, schema, value, pointer) => {
22-
if (typeof value !== "string") {
22+
if (typeof value !== "string" || value === "") {
2323
return undefined;
2424
}
2525
// https://github.com/cfworker/cfworker/blob/main/packages/json-schema/src/format.ts
@@ -42,7 +42,7 @@ const formatValidators = {
4242
return errors.formatDateError({ value, pointer, schema });
4343
},
4444
"date-time": (draft, schema, value, pointer) => {
45-
if (typeof value !== "string") {
45+
if (typeof value !== "string" || value === "") {
4646
return undefined;
4747
}
4848
if (value === "" || isValidDateTime.test(value)) {
@@ -55,7 +55,7 @@ const formatValidators = {
5555
},
5656
email: (draft, schema, value, pointer) => {
5757
// taken from https://github.com/ExodusMovement/schemasafe/blob/master/src/formats.js
58-
if (typeof value !== "string") {
58+
if (typeof value !== "string" || value === "") {
5959
return undefined;
6060
}
6161
if (value[0] === '"') {
@@ -145,7 +145,7 @@ const formatValidators = {
145145
return errors.formatRegExError({ value, pointer, schema });
146146
},
147147
time: (draft, schema, value, pointer) => {
148-
if (typeof value !== "string") {
148+
if (typeof value !== "string" || value === "") {
149149
return undefined;
150150
}
151151
// https://github.com/cfworker/cfworker/blob/main/packages/json-schema/src/format.ts

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "json-schema-library",
3-
"version": "9.0.1",
3+
"version": "9.0.2",
44
"description": "Customizable and hackable json-validator and json-schema utilities for traversal, data generation and validation",
55
"module": "dist/module/index.js",
66
"types": "dist/index.d.ts",

0 commit comments

Comments
 (0)