@orpc/json-schema 2.0.0-beta.30 → 2.0.0-beta.31

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 +3 -3
  2. package/package.json +5 -5
package/dist/index.mjs CHANGED
@@ -1,4 +1,4 @@
1
- import { get, isPlainObject, tryOrUndefined, toArray, isDeepEqual, omit, isTypescriptObject } from '@orpc/shared';
1
+ import { get, isPlainObject, tryOrUndefined, toArray, isDeepEqual, omit, isTypescriptObject, getOwn } from '@orpc/shared';
2
2
  export { Format as JsonSchemaFormat, TypeName as JsonSchemaType } from 'json-schema-typed/draft-2020-12';
3
3
  import { ORPCError, cloneORPCError } from '@orpc/client';
4
4
  import { getProcedureContractOrThrow } from '@orpc/contract';
@@ -826,7 +826,7 @@ function flattenJsonUnionSchemaInternal(schema, resolvingRefs) {
826
826
  }
827
827
  const resolved = resolveJsonSchemaRootLocalRef(schema);
828
828
  if (resolved !== schema) {
829
- const result = flattenJsonUnionSchemaInternal(resolved, resolvingRefs.add(schema.$ref));
829
+ const result = flattenJsonUnionSchemaInternal(resolved, new Set(resolvingRefs).add(schema.$ref));
830
830
  if (result.length > 1) {
831
831
  return result;
832
832
  }
@@ -1022,7 +1022,7 @@ class SmartCoercionLinkPlugin {
1022
1022
  throw error;
1023
1023
  }
1024
1024
  const errorMap = procedure["~orpc"].errorMap;
1025
- const dataSchema = errorMap[error.code]?.data;
1025
+ const dataSchema = getOwn(errorMap, error.code)?.data;
1026
1026
  if (!dataSchema) {
1027
1027
  throw error;
1028
1028
  }
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@orpc/json-schema",
3
3
  "type": "module",
4
- "version": "2.0.0-beta.30",
4
+ "version": "2.0.0-beta.31",
5
5
  "description": "JSON Schema conversion and smart request coercion for oRPC and OpenAPI",
6
6
  "license": "MIT",
7
7
  "funding": [
@@ -37,10 +37,10 @@
37
37
  "dependencies": {
38
38
  "@standard-schema/spec": "^1.1.0",
39
39
  "json-schema-typed": "^8.0.2",
40
- "@orpc/contract": "2.0.0-beta.30",
41
- "@orpc/shared": "2.0.0-beta.30",
42
- "@orpc/client": "2.0.0-beta.30",
43
- "@orpc/server": "2.0.0-beta.30"
40
+ "@orpc/contract": "2.0.0-beta.31",
41
+ "@orpc/client": "2.0.0-beta.31",
42
+ "@orpc/server": "2.0.0-beta.31",
43
+ "@orpc/shared": "2.0.0-beta.31"
44
44
  },
45
45
  "devDependencies": {
46
46
  "zod": "^4.4.3"