@orpc/json-schema 0.0.0 → 1.7.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.
Files changed (2) hide show
  1. package/dist/index.mjs +2 -1
  2. package/package.json +6 -6
package/dist/index.mjs CHANGED
@@ -11,6 +11,7 @@ var JsonSchemaXNativeType = /* @__PURE__ */ ((JsonSchemaXNativeType2) => {
11
11
  return JsonSchemaXNativeType2;
12
12
  })(JsonSchemaXNativeType || {});
13
13
 
14
+ const FLEXIBLE_DATE_FORMAT_REGEX = /^[^-]+-[^-]+-[^-]+$/;
14
15
  class experimental_JsonSchemaCoercer {
15
16
  coerce(schema, value, options = {}) {
16
17
  const [, coerced] = this.#coerce(schema, value, options);
@@ -295,7 +296,7 @@ class experimental_JsonSchemaCoercer {
295
296
  }
296
297
  #stringToDate(value) {
297
298
  const date = new Date(value);
298
- if (Number.isNaN(date.getTime()) || !value.startsWith(date.toISOString().slice(0, 10))) {
299
+ if (Number.isNaN(date.getTime()) || !FLEXIBLE_DATE_FORMAT_REGEX.test(value)) {
299
300
  return value;
300
301
  }
301
302
  return date;
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@orpc/json-schema",
3
3
  "type": "module",
4
- "version": "0.0.0",
4
+ "version": "1.7.1",
5
5
  "license": "MIT",
6
6
  "homepage": "https://orpc.unnoq.com",
7
7
  "repository": {
@@ -25,13 +25,13 @@
25
25
  ],
26
26
  "dependencies": {
27
27
  "json-schema-typed": "^8.0.1",
28
- "@orpc/contract": "1.6.6",
29
- "@orpc/openapi": "1.6.6",
30
- "@orpc/server": "1.6.6",
31
- "@orpc/shared": "1.6.6"
28
+ "@orpc/contract": "1.7.1",
29
+ "@orpc/openapi": "1.7.1",
30
+ "@orpc/server": "1.7.1",
31
+ "@orpc/shared": "1.7.1"
32
32
  },
33
33
  "devDependencies": {
34
- "zod": "^3.25.74"
34
+ "zod": "^4.0.5"
35
35
  },
36
36
  "scripts": {
37
37
  "build": "unbuild",