diff --git a/example/index.ts b/example/index.ts index c7c5a86..a4205cd 100644 --- a/example/index.ts +++ b/example/index.ts @@ -20,4 +20,4 @@ const Z = Box( b: z.string(), c: z.string(), }), -) +) \ No newline at end of file diff --git a/example/prototypes/effect.ts b/example/prototypes/effect.ts new file mode 100644 index 0000000..887f500 --- /dev/null +++ b/example/prototypes/effect.ts @@ -0,0 +1,345 @@ +/*-------------------------------------------------------------------------- + +@sinclair/typebox-adapter + +The MIT License (MIT) + +Copyright (c) 2024 Haydn Paterson (sinclair) + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +THE SOFTWARE. + +---------------------------------------------------------------------------*/ + +import { Schema as et } from '@effect/schema/Schema' +import { Schema as es } from '@effect/schema' +import * as ast from '@effect/schema/AST' +import * as tb from '@sinclair/typebox' + +// ------------------------------------------------------------------ +// Effect Guard +// ------------------------------------------------------------------ +function IsBigInt(type: ast.Annotated) { + return type.annotations[ast.IdentifierAnnotationId] === 'bigint' +} +function IsDate(type: ast.Annotated) { + return type.annotations[ast.IdentifierAnnotationId] === 'Date' +} +function IsInt(type: ast.Annotated) { + return type.annotations[ast.IdentifierAnnotationId] === 'Int' +} +function IsNull(type: ast.Annotated) { + return type instanceof ast.Literal && tb.ValueGuard.IsNull(type.literal) +} +function IsOptional(type: ast.Annotated) { + return 'isOptional' in type && type.isOptional === true +} +function IsUint8Array(type: ast.Annotated) { + return type.annotations[ast.IdentifierAnnotationId] === 'Uint8Array' +} +function IsNumberFromString(type: ast.Annotated) { + return type.annotations[ast.IdentifierAnnotationId] === 'NumberFromString' +} +function IsArray(type: ast.Annotated): type is ast.TupleType { + return type instanceof ast.TupleType && type.rest.length > 0 && type.elements.length === 0 +} +function IsTuple(type: ast.Annotated): type is ast.TupleType { + return type instanceof ast.TupleType && type.rest.length === 0 +} +// ------------------------------------------------------------------ +// Any +// ------------------------------------------------------------------ +type TFromAny<_Type> = tb.TAny +function FromAny(_type: ast.AnyKeyword): tb.TSchema { + return tb.Any() +} +// ------------------------------------------------------------------ +// Array +// ------------------------------------------------------------------ +type TFromArray>> = Result +function FromArray(_type: ast.TupleType): tb.TSchema { + return tb.Array(FromType(_type.rest[0].type)) +} +// ------------------------------------------------------------------ +// BigInt +// ------------------------------------------------------------------ +type TFromBigInt<_Type> = tb.TBigInt +function FromBigInt(_type: ast.Annotated): tb.TSchema { + return tb.BigInt() +} +// ------------------------------------------------------------------ +// Boolean +// ------------------------------------------------------------------ +type TFromBoolean<_Type> = tb.TBoolean +function FromBoolean(_type: ast.BooleanKeyword): tb.TSchema { + return tb.Boolean() +} +// ------------------------------------------------------------------ +// Date +// ------------------------------------------------------------------ +type TFromDate<_Type> = tb.TDate +function FromDate(_type: ast.Annotated): tb.TSchema { + return tb.Date() +} +// ------------------------------------------------------------------ +// Integer +// ------------------------------------------------------------------ +type TFromInteger<_Type> = tb.TNumber +function FromInteger(_type: ast.Annotated): tb.TSchema { + return tb.Number({ multipleOf: 1 }) +} +// ------------------------------------------------------------------ +// Literal: Effect literal types may be union +// ------------------------------------------------------------------ +// prettier-ignore +type TFromLiteral = ( + Value extends [infer Left extends unknown, ...infer Right extends unknown[]] + ? ( + Left extends tb.TLiteralValue + ? TFromLiteral]> + : TFromLiteral + ) : tb.TUnionEvaluated +) +function FromLiteral(type: ast.Literal): tb.TSchema { + return tb.KindGuard.IsLiteralValue(type.literal) ? tb.Literal(type.literal) : tb.Unknown() +} +// ------------------------------------------------------------------ +// FromNever +// ------------------------------------------------------------------ +function FromNever(_type: ast.NeverKeyword): tb.TSchema { + return tb.Never() +} +type TFromNever<_Type, Result extends tb.TSchema = tb.TNever> = Result +// ------------------------------------------------------------------ +// NullishOr +// ------------------------------------------------------------------ +type TFromNullishOr, tb.TNull, tb.TUndefined]>> = Result +// ------------------------------------------------------------------ +// NullOr +// ------------------------------------------------------------------ +type TFromNullOr, tb.TNull]>> = Result +// ------------------------------------------------------------------ +// Null +// ------------------------------------------------------------------ +type TFromNull<_Type> = tb.TNull +function FromNull(_type: ast.Annotated): tb.TSchema { + return tb.Null() +} +// ------------------------------------------------------------------ +// Number +// ------------------------------------------------------------------ +type TFromNumber<_Type> = tb.TNumber +function FromNumber(_type: ast.NumberKeyword): tb.TSchema { + return tb.Number() +} +// ------------------------------------------------------------------ +// Object +// ------------------------------------------------------------------ +type TFromObject<_Type> = tb.TObject +function FromObject(type: ast.ObjectKeyword): tb.TSchema { + return tb.Object({}) +} +// ------------------------------------------------------------------ +// Optional +// ------------------------------------------------------------------ +type TFromOptional, Result = tb.TOptional> = Result +function FromOptional(type: ast.Annotated): tb.TSchema { + return tb.Optional(FromType(type)) +} +// ------------------------------------------------------------------ +// Record +// ------------------------------------------------------------------ +type TFromRecord = tb.TRecordOrObject, TFromType> +// ------------------------------------------------------------------ +// SchemaClass: TypeLiteral +// ------------------------------------------------------------------ +type TFromSchemaClass> = Result +// ------------------------------------------------------------------ +// String +// ------------------------------------------------------------------ +type TFromString<_Type> = tb.TString +function FromString(_type: ast.Annotated): tb.TSchema { + return tb.String() +} +// ------------------------------------------------------------------ +// Struct +// ------------------------------------------------------------------ +// prettier-ignore +type TFromStruct, + Mapped extends tb.TProperties = { [Key in keyof Properties]: TFromType }, + Result = tb.TObject +> = Result +// prettier-ignore +function FromStruct(type: ast.TypeLiteral): tb.TSchema { + const properties = type.propertySignatures.reduce((result, property) => { + const mappedProperty = property.isOptional ? tb.Optional(FromType(property.type)) : FromType(property.type) + return { ...result, [property.name]: mappedProperty } + }, {} as tb.TProperties) as tb.TProperties + return tb.Object(properties) +} +// ------------------------------------------------------------------ +// Symbol +// ------------------------------------------------------------------ +type TFromSymbol<_Type> = tb.TSymbol +function FromSymbol(_type: ast.Annotated): tb.TSchema { + return tb.Symbol() +} +// ------------------------------------------------------------------ +// Tuple +// ------------------------------------------------------------------ +// prettier-ignore +type TFromTuple = ( + Types extends [infer Left extends unknown, ...infer Right extends unknown[]] + ? TFromTuple]> + : tb.TTuple +) +function FromTuple(type: ast.TupleType): tb.TSchema { + return tb.Tuple(type.elements.map((type) => FromType(type.type))) +} +// ------------------------------------------------------------------ +// UndefinedOr +// ------------------------------------------------------------------ +type TFromUndefinedOr, tb.TUndefined]>> = Result +// ------------------------------------------------------------------ +// Undefined +// ------------------------------------------------------------------ +type TFromUndefined<_Type> = tb.TUndefined +function FromUndefined(_type: ast.Annotated): tb.TSchema { + return tb.Undefined() +} +// ------------------------------------------------------------------ +// Uint8Array +// ------------------------------------------------------------------ +type TFromUint8Array<_Type> = tb.TUint8Array +function FromUint8Array(_type: ast.Annotated): tb.TSchema { + return tb.Uint8Array() +} +// ------------------------------------------------------------------ +// Unknown +// ------------------------------------------------------------------ +type TFromUnknown<_Type> = tb.TUnknown +function FromUnknown(_type: ast.Annotated): tb.TSchema { + return tb.Unknown() +} +// ------------------------------------------------------------------ +// Union +// ------------------------------------------------------------------ +// prettier-ignore +type TFromUnion = ( + Variants extends [infer Left extends unknown, ...infer Right extends unknown[]] + ? TFromUnion]> + : tb.TUnionEvaluated +) +function FromUnion(type: ast.Union): tb.TSchema { + return tb.Union(type.types.map((type) => FromType(type))) +} +// ------------------------------------------------------------------ +// Void +// ------------------------------------------------------------------ +type TFromVoid<_Type> = tb.TVoid +function FromVoid(_type: ast.VoidKeyword): tb.TSchema { + return tb.Void() +} +// ------------------------------------------------------------------ +// Type +// +// Note: Type differentition in Effect is quite challenging as the +// library doesn't provide discriminable types in all cases. An +// example would be Number and Integer where both are observed +// as Number. Unions also provide challenges for NullishOr and +// similar types. The order in which we resolve is important. +// ------------------------------------------------------------------ +// prettier-ignore +type TFromType = ( + Type extends es.optional ? TFromOptional : + Type extends es.Tuple ? TFromTuple : + Type extends es.Record$ ? TFromRecord : + Type extends es.Array$ ? TFromArray : + Type extends es.Date ? TFromDate : + Type extends es.Struct ? TFromStruct : + Type extends es.SchemaClass ? TFromSchemaClass : + Type extends es.Literal ? TFromLiteral : + Type extends es.Int ? TFromInteger : + Type extends es.BigInt ? TFromBigInt : + Type extends es.Boolean ? TFromBoolean : + Type extends es.Object ? TFromObject : + Type extends es.Never ? TFromNever : + Type extends es.Null ? TFromNull : + Type extends es.Number ? TFromNumber : + Type extends es.String ? TFromString : + Type extends es.Symbol ? TFromSymbol : + Type extends et ? TFromUint8Array : + Type extends es.Undefined ? TFromUndefined : + Type extends es.Void ? TFromVoid : + // Union-Like + Type extends es.UndefinedOr ? TFromUndefinedOr : + Type extends es.NullishOr ? TFromNullishOr : + Type extends es.NullOr ? TFromNullOr : + Type extends es.Union ? TFromUnion : + // Fallthrough + Type extends es.Unknown ? TFromUnknown : + Type extends es.Any ? TFromAny : + tb.TUnknown +) +// prettier-ignore +function FromType(type: ast.Annotated): tb.TSchema { + const schema = ( + // Non-Differentiable + IsOptional(type) ? FromOptional(type) : + IsArray(type) ? FromArray(type) : + IsBigInt(type) ? FromBigInt(type) : + IsDate(type) ? FromDate(type) : + IsInt(type) ? FromInteger(type) : + IsNull(type) ? FromNull(type) : + IsTuple(type) ? FromTuple(type) : + IsUint8Array(type) ? FromUint8Array(type) : + // Differentiable + type instanceof ast.AnyKeyword ? FromAny(type) : + type instanceof ast.BooleanKeyword ? FromBoolean(type) : + type instanceof ast.Literal ? FromLiteral(type) : + type instanceof ast.NeverKeyword ? FromNever(type) : + type instanceof ast.NumberKeyword ? FromNumber(type) : + type instanceof ast.ObjectKeyword ? FromObject(type) : + type instanceof ast.StringKeyword ? FromString(type) : + type instanceof ast.SymbolKeyword ? FromSymbol(type) : + type instanceof ast.TypeLiteral ? FromStruct(type) : + type instanceof ast.UndefinedKeyword ? FromUndefined(type) : + type instanceof ast.UnknownKeyword ? FromUnknown(type) : + type instanceof ast.Union ? FromUnion(type) : + type instanceof ast.VoidKeyword ? FromVoid(type) : + tb.Unknown() + ) + return schema +} +// ------------------------------------------------------------------ +// Box +// ------------------------------------------------------------------ +/** Converts an Effect Type to a TypeBox Type */ +// prettier-ignore +export type TBox = ( + Type extends es.Any ? TFromType : undefined +) +/** Converts an Effect Type to a TypeBox Type */ +// prettier-ignore +export function Box(type: Type): TBox { + return ( + es.isSchema(type) + ? FromType(type.ast) + : undefined + ) as never +} diff --git a/example/prototypes/index.ts b/example/prototypes/index.ts new file mode 100644 index 0000000..887b7f0 --- /dev/null +++ b/example/prototypes/index.ts @@ -0,0 +1 @@ +export * as Effect from './effect' \ No newline at end of file diff --git a/package-lock.json b/package-lock.json index 3a22af4..3f36592 100644 --- a/package-lock.json +++ b/package-lock.json @@ -8,8 +8,13 @@ "name": "@sinclair/typebox-adapter", "version": "0.9.1", "license": "MIT", + "dependencies": { + "valibot": "^1.0.0-beta.13", + "zod": "^3.24.1" + }, "devDependencies": { "@arethetypeswrong/cli": "^0.17.2", + "@effect/schema": "^0.75.5", "@sinclair/hammer": "^0.18.0", "@types/mocha": "^10.0.10", "@types/node": "^22.10.2", @@ -18,11 +23,11 @@ "typescript": "^5.7.2" }, "optionalDependencies": { - "valibot": "^1.0.0-beta.11", + "valibot": "^1.0.0-beta.13", "zod": "^3.24.1" }, "peerDependencies": { - "@sinclair/typebox": "^0.34.13" + "@sinclair/typebox": "^0.34.14" } }, "node_modules/@andrewbranch/untar.js": { @@ -93,6 +98,18 @@ "node": ">=0.1.90" } }, + "node_modules/@effect/schema": { + "version": "0.75.5", + "resolved": "https://registry.npmjs.org/@effect/schema/-/schema-0.75.5.tgz", + "integrity": "sha512-TQInulTVCuF+9EIbJpyLP6dvxbQJMphrnRqgexm/Ze39rSjfhJuufF7XvU3SxTgg3HnL7B/kpORTJbHhlE6thw==", + "dev": true, + "dependencies": { + "fast-check": "^3.21.0" + }, + "peerDependencies": { + "effect": "^3.9.2" + } + }, "node_modules/@esbuild/linux-loong64": { "version": "0.15.7", "resolved": "https://registry.npmjs.org/@esbuild/linux-loong64/-/linux-loong64-0.15.7.tgz", @@ -172,9 +189,9 @@ } }, "node_modules/@sinclair/typebox": { - "version": "0.34.13", - "resolved": "https://registry.npmjs.org/@sinclair/typebox/-/typebox-0.34.13.tgz", - "integrity": "sha512-ceVKqyCEgC355Kw0s/0tyfY9MzMQINSykJ/pG2w6YnaZyrcjV48svZpr8lVZrYgWjzOmrIPBhQRAtr/7eJpA5g==", + "version": "0.34.14", + "resolved": "https://registry.npmjs.org/@sinclair/typebox/-/typebox-0.34.14.tgz", + "integrity": "sha512-TJ7Al17j3+by5y2QkTLcF/oBVMbgXBhILVgi9PuwpxQVZZvGh5BFRzWbJPmZVNKpbRLjuMzFuRwR+tdFPqCkvA==", "peer": true }, "node_modules/@sindresorhus/is": { @@ -196,9 +213,9 @@ "dev": true }, "node_modules/@types/node": { - "version": "22.10.6", - "resolved": "https://registry.npmjs.org/@types/node/-/node-22.10.6.tgz", - "integrity": "sha512-qNiuwC4ZDAUNcY47xgaSuS92cjf8JbSUoaKS77bmLG1rU7MlATVSiw/IlrjtIyyskXBZ8KkNfjK/P5na7rgXbQ==", + "version": "22.10.7", + "resolved": "https://registry.npmjs.org/@types/node/-/node-22.10.7.tgz", + "integrity": "sha512-V09KvXxFiutGp6B7XkpaDXlNadZxrzajcY50EuoLIpQ6WWYCSvf19lVIazzfIzQvhUN2HjX12spLojTnhuKlGg==", "dev": true, "dependencies": { "undici-types": "~6.20.0" @@ -562,6 +579,16 @@ "integrity": "sha512-I88TYZWc9XiYHRQ4/3c5rjjfgkjhLyW2luGIheGERbNQ6OY7yTybanSpDXZa8y7VUP9YmDcYa+eyq4ca7iLqWA==", "dev": true }, + "node_modules/effect": { + "version": "3.12.6", + "resolved": "https://registry.npmjs.org/effect/-/effect-3.12.6.tgz", + "integrity": "sha512-4gNxRpXduuvVv03528sPLGglkCAX9szGBUA6oIG3YL+6ap82JmbVp4OIa+xTurype+H9b4/I4M2ubxDxJJ01Og==", + "dev": true, + "peer": true, + "dependencies": { + "fast-check": "^3.23.1" + } + }, "node_modules/emoji-regex": { "version": "8.0.0", "resolved": "https://registry.npmjs.org/emoji-regex/-/emoji-regex-8.0.0.tgz", @@ -963,6 +990,28 @@ "url": "https://github.com/sponsors/sindresorhus" } }, + "node_modules/fast-check": { + "version": "3.23.2", + "resolved": "https://registry.npmjs.org/fast-check/-/fast-check-3.23.2.tgz", + "integrity": "sha512-h5+1OzzfCC3Ef7VbtKdcv7zsstUQwUDlYpUTvjeUsJAssPgLn7QzbboPtL5ro04Mq0rPOsMzl7q5hIbRs2wD1A==", + "dev": true, + "funding": [ + { + "type": "individual", + "url": "https://github.com/sponsors/dubzzz" + }, + { + "type": "opencollective", + "url": "https://opencollective.com/fast-check" + } + ], + "dependencies": { + "pure-rand": "^6.1.0" + }, + "engines": { + "node": ">=8.0.0" + } + }, "node_modules/fflate": { "version": "0.8.2", "resolved": "https://registry.npmjs.org/fflate/-/fflate-0.8.2.tgz", @@ -1545,6 +1594,22 @@ "url": "https://github.com/prettier/prettier?sponsor=1" } }, + "node_modules/pure-rand": { + "version": "6.1.0", + "resolved": "https://registry.npmjs.org/pure-rand/-/pure-rand-6.1.0.tgz", + "integrity": "sha512-bVWawvoZoBYpp6yIoQtQXHZjmz35RSVHnUOTefl8Vcjr8snTPY1wnpSPMWekcFwbxI6gtmT7rSYPFvz71ldiOA==", + "dev": true, + "funding": [ + { + "type": "individual", + "url": "https://github.com/sponsors/dubzzz" + }, + { + "type": "opencollective", + "url": "https://opencollective.com/fast-check" + } + ] + }, "node_modules/randombytes": { "version": "2.1.0", "resolved": "https://registry.npmjs.org/randombytes/-/randombytes-2.1.0.tgz", @@ -1871,9 +1936,9 @@ } }, "node_modules/valibot": { - "version": "1.0.0-beta.11", - "resolved": "https://registry.npmjs.org/valibot/-/valibot-1.0.0-beta.11.tgz", - "integrity": "sha512-Ztl5Iks1Ql7Z6CwkS5oyqguN3G8tmUiNlsHpqbDt6DLMpm+eu+n8Q7f921gI3uHvNZ8xDVkd4cEJP5t+lELOfw==", + "version": "1.0.0-beta.13", + "resolved": "https://registry.npmjs.org/valibot/-/valibot-1.0.0-beta.13.tgz", + "integrity": "sha512-WCAqfG126/nadCrK36lOgVHrYWeWJfxb52PYE48gqg/8clLTy9sWjE6v/W43cVtgR+rSt30J1IAswk6ovT48pQ==", "optional": true, "peerDependencies": { "typescript": ">=5" @@ -2130,6 +2195,15 @@ "dev": true, "optional": true }, + "@effect/schema": { + "version": "0.75.5", + "resolved": "https://registry.npmjs.org/@effect/schema/-/schema-0.75.5.tgz", + "integrity": "sha512-TQInulTVCuF+9EIbJpyLP6dvxbQJMphrnRqgexm/Ze39rSjfhJuufF7XvU3SxTgg3HnL7B/kpORTJbHhlE6thw==", + "dev": true, + "requires": { + "fast-check": "^3.21.0" + } + }, "@esbuild/linux-loong64": { "version": "0.15.7", "resolved": "https://registry.npmjs.org/@esbuild/linux-loong64/-/linux-loong64-0.15.7.tgz", @@ -2187,9 +2261,9 @@ } }, "@sinclair/typebox": { - "version": "0.34.13", - "resolved": "https://registry.npmjs.org/@sinclair/typebox/-/typebox-0.34.13.tgz", - "integrity": "sha512-ceVKqyCEgC355Kw0s/0tyfY9MzMQINSykJ/pG2w6YnaZyrcjV48svZpr8lVZrYgWjzOmrIPBhQRAtr/7eJpA5g==", + "version": "0.34.14", + "resolved": "https://registry.npmjs.org/@sinclair/typebox/-/typebox-0.34.14.tgz", + "integrity": "sha512-TJ7Al17j3+by5y2QkTLcF/oBVMbgXBhILVgi9PuwpxQVZZvGh5BFRzWbJPmZVNKpbRLjuMzFuRwR+tdFPqCkvA==", "peer": true }, "@sindresorhus/is": { @@ -2205,9 +2279,9 @@ "dev": true }, "@types/node": { - "version": "22.10.6", - "resolved": "https://registry.npmjs.org/@types/node/-/node-22.10.6.tgz", - "integrity": "sha512-qNiuwC4ZDAUNcY47xgaSuS92cjf8JbSUoaKS77bmLG1rU7MlATVSiw/IlrjtIyyskXBZ8KkNfjK/P5na7rgXbQ==", + "version": "22.10.7", + "resolved": "https://registry.npmjs.org/@types/node/-/node-22.10.7.tgz", + "integrity": "sha512-V09KvXxFiutGp6B7XkpaDXlNadZxrzajcY50EuoLIpQ6WWYCSvf19lVIazzfIzQvhUN2HjX12spLojTnhuKlGg==", "dev": true, "requires": { "undici-types": "~6.20.0" @@ -2467,6 +2541,16 @@ "integrity": "sha512-I88TYZWc9XiYHRQ4/3c5rjjfgkjhLyW2luGIheGERbNQ6OY7yTybanSpDXZa8y7VUP9YmDcYa+eyq4ca7iLqWA==", "dev": true }, + "effect": { + "version": "3.12.6", + "resolved": "https://registry.npmjs.org/effect/-/effect-3.12.6.tgz", + "integrity": "sha512-4gNxRpXduuvVv03528sPLGglkCAX9szGBUA6oIG3YL+6ap82JmbVp4OIa+xTurype+H9b4/I4M2ubxDxJJ01Og==", + "dev": true, + "peer": true, + "requires": { + "fast-check": "^3.23.1" + } + }, "emoji-regex": { "version": "8.0.0", "resolved": "https://registry.npmjs.org/emoji-regex/-/emoji-regex-8.0.0.tgz", @@ -2666,6 +2750,15 @@ "integrity": "sha512-TtpcNJ3XAzx3Gq8sWRzJaVajRs0uVxA2YAkdb1jm2YkPz4G6egUFAyA3n5vtEIZefPk5Wa4UXbKuS5fKkJWdgA==", "dev": true }, + "fast-check": { + "version": "3.23.2", + "resolved": "https://registry.npmjs.org/fast-check/-/fast-check-3.23.2.tgz", + "integrity": "sha512-h5+1OzzfCC3Ef7VbtKdcv7zsstUQwUDlYpUTvjeUsJAssPgLn7QzbboPtL5ro04Mq0rPOsMzl7q5hIbRs2wD1A==", + "dev": true, + "requires": { + "pure-rand": "^6.1.0" + } + }, "fflate": { "version": "0.8.2", "resolved": "https://registry.npmjs.org/fflate/-/fflate-0.8.2.tgz", @@ -3075,6 +3168,12 @@ "integrity": "sha512-e9MewbtFo+Fevyuxn/4rrcDAaq0IYxPGLvObpQjiZBMAzB9IGmzlnG9RZy3FFas+eBMu2vA0CszMeduow5dIuQ==", "dev": true }, + "pure-rand": { + "version": "6.1.0", + "resolved": "https://registry.npmjs.org/pure-rand/-/pure-rand-6.1.0.tgz", + "integrity": "sha512-bVWawvoZoBYpp6yIoQtQXHZjmz35RSVHnUOTefl8Vcjr8snTPY1wnpSPMWekcFwbxI6gtmT7rSYPFvz71ldiOA==", + "dev": true + }, "randombytes": { "version": "2.1.0", "resolved": "https://registry.npmjs.org/randombytes/-/randombytes-2.1.0.tgz", @@ -3303,9 +3402,9 @@ "dev": true }, "valibot": { - "version": "1.0.0-beta.11", - "resolved": "https://registry.npmjs.org/valibot/-/valibot-1.0.0-beta.11.tgz", - "integrity": "sha512-Ztl5Iks1Ql7Z6CwkS5oyqguN3G8tmUiNlsHpqbDt6DLMpm+eu+n8Q7f921gI3uHvNZ8xDVkd4cEJP5t+lELOfw==", + "version": "1.0.0-beta.13", + "resolved": "https://registry.npmjs.org/valibot/-/valibot-1.0.0-beta.13.tgz", + "integrity": "sha512-WCAqfG126/nadCrK36lOgVHrYWeWJfxb52PYE48gqg/8clLTy9sWjE6v/W43cVtgR+rSt30J1IAswk6ovT48pQ==", "optional": true, "requires": {} }, diff --git a/package.json b/package.json index ebf3fb3..a2f9deb 100644 --- a/package.json +++ b/package.json @@ -18,14 +18,15 @@ "publish": "hammer task publish" }, "peerDependencies": { - "@sinclair/typebox": "^0.34.13" + "@sinclair/typebox": "^0.34.14" }, "optionalDependencies": { - "valibot": "^1.0.0-beta.11", + "valibot": "^1.0.0-beta.13", "zod": "^3.24.1" }, "devDependencies": { "@arethetypeswrong/cli": "^0.17.2", + "@effect/schema": "^0.75.5", "@sinclair/hammer": "^0.18.0", "@types/mocha": "^10.0.10", "@types/node": "^22.10.2",