Skip to content

Commit 3391b46

Browse files
committed
Don't include ajv-formats and inline the date-time format regex
1 parent dfd65cb commit 3391b46

File tree

3 files changed

+9
-36
lines changed

3 files changed

+9
-36
lines changed

build/compile-validators.js

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,6 @@
88
* - to reduce the browser bundle size - Ajv is not included in the bundle
99
* - to reduce the start-up time - the validation and compilation of schemas will happen during build time.
1010
*/
11-
import addFormats from 'ajv-formats';
1211

1312
import fs from 'node:fs';
1413
import path from 'node:path';
@@ -62,7 +61,7 @@ const schemas = {
6261
};
6362

6463
const ajv = new Ajv({ code: { source: true, esm: true } });
65-
addFormats(ajv);
64+
ajv.addFormat('date-time', /^\d\d\d\d-[0-1]\d-[0-3]\dt(?:[0-2]\d:[0-5]\d:[0-5]\d|23:59:60)(?:\.\d+)?(?:z|[+-]\d\d(?::?\d\d)?)$/i);
6665

6766
for (const schemaName in schemas) {
6867
ajv.addSchema(schemas[schemaName], schemaName);

package-lock.json

Lines changed: 7 additions & 32 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -60,8 +60,7 @@
6060
"@types/readable-stream": "2.3.15",
6161
"@types/secp256k1": "4.0.3",
6262
"abstract-level": "1.0.3",
63-
"ajv": "8.12.0",
64-
"ajv-formats": "^3.0.0-rc.0",
63+
"ajv": "8.11.0",
6564
"blockstore-core": "3.0.0",
6665
"cross-fetch": "3.1.5",
6766
"date-fns": "2.28.0",

0 commit comments

Comments
 (0)