@forklaunch/validator
Advanced tools
Comparing version
import { SchemaObject } from 'openapi3-ts/oas31'; | ||
import { S as SchemaValidator, L as LiteralSchema, a as ParseResult } from '../../schema.types-Df9EB_Ke.js'; | ||
import { S as SchemaValidator, L as LiteralSchema, a as ParseResult } from '../../schema.types-BbvfIwCw.js'; | ||
import '@forklaunch/common'; | ||
@@ -4,0 +4,0 @@ import '@sinclair/typebox'; |
@@ -1,3 +0,3 @@ | ||
import { P as ParseError } from './schema.types-Df9EB_Ke.js'; | ||
export { A as AnySchemaValidator, I as IdiomaticSchema, e as Increment, K as KeyTypes, L as LiteralSchema, a as ParseResult, d as Schema, b as SchemaResolve, c as SchemaTranslate, S as SchemaValidator, U as UnboxedObjectSchema } from './schema.types-Df9EB_Ke.js'; | ||
import { P as ParseError } from './schema.types-BbvfIwCw.js'; | ||
export { A as AnySchemaValidator, I as IdiomaticSchema, e as Increment, K as KeyTypes, L as LiteralSchema, a as ParseResult, d as Schema, b as SchemaResolve, c as SchemaTranslate, S as SchemaValidator, U as UnboxedObjectSchema } from './schema.types-BbvfIwCw.js'; | ||
import '@forklaunch/common'; | ||
@@ -4,0 +4,0 @@ import 'openapi3-ts/oas31'; |
@@ -1,3 +0,3 @@ | ||
import { T as TypeboxSchemaValidator } from '../../schema.types-Df9EB_Ke.js'; | ||
export { f as TCatchall, l as TIdiomaticSchema, i as TObject, h as TObjectShape, g as TOuterArray, o as TResolve, j as TSchemaTranslate, m as TUnionTupleContainer, k as UnboxedTObjectSchema, n as UnionTupleTResolve } from '../../schema.types-Df9EB_Ke.js'; | ||
import { T as TypeboxSchemaValidator } from '../../schema.types-BbvfIwCw.js'; | ||
export { f as TCatchall, l as TIdiomaticSchema, i as TObject, h as TObjectShape, g as TOuterArray, o as TResolve, j as TSchemaTranslate, m as TUnionTupleContainer, k as UnboxedTObjectSchema, n as UnionTupleTResolve } from '../../schema.types-BbvfIwCw.js'; | ||
import '@forklaunch/common'; | ||
@@ -88,2 +88,6 @@ import 'openapi3-ts/oas31'; | ||
/** | ||
* TypeBox schema definition for type type. | ||
*/ | ||
declare const type: typeof StaticSchemaValidator.type; | ||
/** | ||
* Transforms valid schema into TypeBox schema. | ||
@@ -141,2 +145,2 @@ */ | ||
export { SchemaValidator, TypeboxSchemaValidator, any, array, bigint, binary, boolean, date, email, enum_, file, function_, isSchema, literal, never, null_, nullish, number, openapi, optional, parse, promise, record, schemify, string, symbol, undefined_, union, unknown, uri, uuid, validate, void_ }; | ||
export { SchemaValidator, TypeboxSchemaValidator, any, array, bigint, binary, boolean, date, email, enum_, file, function_, isSchema, literal, never, null_, nullish, number, openapi, optional, parse, promise, record, schemify, string, symbol, type, undefined_, union, unknown, uri, uuid, validate, void_ }; |
@@ -48,2 +48,3 @@ "use strict"; | ||
symbol: () => symbol, | ||
type: () => type, | ||
undefined_: () => undefined_, | ||
@@ -264,4 +265,5 @@ union: () => union, | ||
).Decode( | ||
(value) => (name, type) => new import_common.InMemoryFile(value, name, { type }) | ||
(value) => (name, type2) => new import_common.InMemoryFile(value, name, { type: type2 }) | ||
).Encode((value) => value("name", "type").content); | ||
type = () => this.any; | ||
/** | ||
@@ -416,4 +418,4 @@ * Extracts the error type of a schema for error messages. | ||
*/ | ||
isInstanceOf(value, type) { | ||
return typeof value === "object" && value != null && import_typebox.Kind in value && value[import_typebox.Kind] === type[import_typebox.Kind]; | ||
isInstanceOf(value, type2) { | ||
return typeof value === "object" && value != null && import_typebox.Kind in value && value[import_typebox.Kind] === type2[import_typebox.Kind]; | ||
} | ||
@@ -550,2 +552,3 @@ /** | ||
var file = StaticSchemaValidator.file; | ||
var type = StaticSchemaValidator.type; | ||
var schemify = StaticSchemaValidator.schemify.bind(StaticSchemaValidator); | ||
@@ -591,2 +594,3 @@ var optional = StaticSchemaValidator.optional.bind(StaticSchemaValidator); | ||
symbol, | ||
type, | ||
undefined_, | ||
@@ -593,0 +597,0 @@ union, |
@@ -1,3 +0,3 @@ | ||
import { Z as ZodSchemaValidator } from '../../schema.types-Df9EB_Ke.js'; | ||
export { x as TupleZodResolve, u as UnboxedZodObjectSchema, z as UnionZodResolve, p as ZodCatchall, v as ZodIdiomaticSchema, s as ZodObject, r as ZodObjectShape, q as ZodOuterArray, C as ZodRecordKey, B as ZodResolve, t as ZodSchemaTranslate, w as ZodTupleContainer, y as ZodUnionContainer } from '../../schema.types-Df9EB_Ke.js'; | ||
import { Z as ZodSchemaValidator } from '../../schema.types-BbvfIwCw.js'; | ||
export { x as TupleZodResolve, u as UnboxedZodObjectSchema, z as UnionZodResolve, p as ZodCatchall, v as ZodIdiomaticSchema, s as ZodObject, r as ZodObjectShape, q as ZodOuterArray, C as ZodRecordKey, B as ZodResolve, t as ZodSchemaTranslate, w as ZodTupleContainer, y as ZodUnionContainer } from '../../schema.types-BbvfIwCw.js'; | ||
import '@forklaunch/common'; | ||
@@ -88,2 +88,6 @@ import 'openapi3-ts/oas31'; | ||
/** | ||
* Zod schema definition for type type. | ||
*/ | ||
declare const type: typeof StaticSchemaValidator.type; | ||
/** | ||
* Transforms valid schema into Zod schema. | ||
@@ -141,2 +145,2 @@ */ | ||
export { SchemaValidator, ZodSchemaValidator, any, array, bigint, binary, boolean, date, email, enum_, file, function_, isSchema, literal, never, null_, nullish, number, openapi, optional, parse, promise, record, schemify, string, symbol, undefined_, union, unknown, uri, uuid, validate, void_ }; | ||
export { SchemaValidator, ZodSchemaValidator, any, array, bigint, binary, boolean, date, email, enum_, file, function_, isSchema, literal, never, null_, nullish, number, openapi, optional, parse, promise, record, schemify, string, symbol, type, undefined_, union, unknown, uri, uuid, validate, void_ }; |
@@ -48,2 +48,3 @@ "use strict"; | ||
symbol: () => symbol, | ||
type: () => type, | ||
undefined_: () => undefined_, | ||
@@ -197,4 +198,4 @@ union: () => union, | ||
file = import_zod.z.string().transform((val) => { | ||
return (name, type) => new File([val], name, { | ||
type, | ||
return (name, type2) => new File([val], name, { | ||
type: type2, | ||
lastModified: Date.now() | ||
@@ -208,2 +209,3 @@ }); | ||
}); | ||
type = () => this.any; | ||
/** | ||
@@ -331,4 +333,4 @@ * Compiles schema if this exists, for optimal performance. | ||
*/ | ||
isInstanceOf(value, type) { | ||
return this.isSchema(value) && type._def.typeName === value._def.typeName; | ||
isInstanceOf(value, type2) { | ||
return this.isSchema(value) && type2._def.typeName === value._def.typeName; | ||
} | ||
@@ -412,2 +414,3 @@ /** | ||
var file = StaticSchemaValidator.file; | ||
var type = StaticSchemaValidator.type; | ||
var schemify = StaticSchemaValidator.schemify.bind(StaticSchemaValidator); | ||
@@ -453,2 +456,3 @@ var optional = StaticSchemaValidator.optional.bind(StaticSchemaValidator); | ||
symbol, | ||
type, | ||
undefined_, | ||
@@ -455,0 +459,0 @@ union, |
{ | ||
"name": "@forklaunch/validator", | ||
"version": "0.6.9", | ||
"version": "0.6.10", | ||
"description": "Schema validator for ForkLaunch components.", | ||
@@ -63,4 +63,4 @@ "homepage": "https://github.com/forklaunch/forklaunch-js#readme", | ||
"@sinclair/typebox": "^0.34.33", | ||
"zod": "^3.25.58", | ||
"@forklaunch/common": "0.3.9" | ||
"zod": "^3.25.61", | ||
"@forklaunch/common": "0.3.10" | ||
}, | ||
@@ -71,3 +71,3 @@ "devDependencies": { | ||
"@types/node": "^24.0.0", | ||
"@typescript/native-preview": "7.0.0-dev.20250610.1", | ||
"@typescript/native-preview": "7.0.0-dev.20250611.1", | ||
"@vitest/coverage-v8": "^3.2.3", | ||
@@ -74,0 +74,0 @@ "eslint-config-prettier": "^10.1.5", |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
184559
0.5%3789
0.64%+ Added
- Removed
Updated
Updated