@forklaunch/validator 0.4.3 → 0.4.5

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.
package/lib/index.d.mts CHANGED
@@ -1,5 +1,5 @@
1
- import { P as ParseError } from './schema.types-Do9dhcdB.mjs';
2
- 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-Do9dhcdB.mjs';
1
+ import { P as ParseError } from './schema.types-CA4Aof4g.mjs';
2
+ 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-CA4Aof4g.mjs';
3
3
  import '@forklaunch/common';
4
4
  import 'openapi3-ts/oas31';
5
5
  import '@sinclair/typebox';
package/lib/index.d.ts CHANGED
@@ -1,5 +1,5 @@
1
- import { P as ParseError } from './schema.types-Do9dhcdB.js';
2
- 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-Do9dhcdB.js';
1
+ import { P as ParseError } from './schema.types-CA4Aof4g.js';
2
+ 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-CA4Aof4g.js';
3
3
  import '@forklaunch/common';
4
4
  import 'openapi3-ts/oas31';
5
5
  import '@sinclair/typebox';
@@ -1,8 +1,8 @@
1
1
  import { Prettify } from '@forklaunch/common';
2
2
  import { SchemaObject } from 'openapi3-ts/oas31';
3
- import { TObject as TObject$1, TNever, StaticDecode, TUnknown, TLiteral, TSchema, TKind, TProperties } from '@sinclair/typebox';
3
+ import { TUnknown, TLiteral, TSchema, TKind, TProperties, TObject as TObject$1, TNever, StaticDecode } from '@sinclair/typebox';
4
4
  import { TypeCheck } from '@sinclair/typebox/compiler';
5
- import { ZodObject as ZodObject$1, ZodRawShape, ZodOptional, ZodArray, ZodUnion, ZodLiteral, ZodType, z, ZodTypeAny, ZodNever, ZodUnknown } from 'zod';
5
+ import { ZodObject as ZodObject$1, ZodRawShape, ZodOptional, ZodArray, ZodUnion, ZodLiteral, ZodType, z, ZodUnknown, ZodNever, ZodTypeAny } from 'zod';
6
6
 
7
7
  /**
8
8
  * Represents a catch-all schema type.
@@ -1,8 +1,8 @@
1
1
  import { Prettify } from '@forklaunch/common';
2
2
  import { SchemaObject } from 'openapi3-ts/oas31';
3
- import { TObject as TObject$1, TNever, StaticDecode, TUnknown, TLiteral, TSchema, TKind, TProperties } from '@sinclair/typebox';
3
+ import { TUnknown, TLiteral, TSchema, TKind, TProperties, TObject as TObject$1, TNever, StaticDecode } from '@sinclair/typebox';
4
4
  import { TypeCheck } from '@sinclair/typebox/compiler';
5
- import { ZodObject as ZodObject$1, ZodRawShape, ZodOptional, ZodArray, ZodUnion, ZodLiteral, ZodType, z, ZodTypeAny, ZodNever, ZodUnknown } from 'zod';
5
+ import { ZodObject as ZodObject$1, ZodRawShape, ZodOptional, ZodArray, ZodUnion, ZodLiteral, ZodType, z, ZodUnknown, ZodNever, ZodTypeAny } from 'zod';
6
6
 
7
7
  /**
8
8
  * Represents a catch-all schema type.
@@ -2,7 +2,7 @@ import * as openapi3_ts_oas31 from 'openapi3-ts/oas31';
2
2
  import { SchemaObject } from 'openapi3-ts/oas31';
3
3
  import * as _sinclair_typebox_compiler from '@sinclair/typebox/compiler';
4
4
  import { TypeCheck } from '@sinclair/typebox/compiler';
5
- import { S as SchemaValidator$1, T as TObject, f as TIdiomaticSchema, g as TResolve, h as TUnionContainer, i as UnionTResolve, L as LiteralSchema, a as ParseResult } from '../../schema.types-Do9dhcdB.mjs';
5
+ import { S as SchemaValidator$1, T as TObject, f as TIdiomaticSchema, g as TResolve, h as TUnionContainer, i as UnionTResolve, L as LiteralSchema, a as ParseResult } from '../../schema.types-CA4Aof4g.mjs';
6
6
  import * as _sinclair_typebox from '@sinclair/typebox';
7
7
  import { TProperties, TOptional, TArray, TUnion, TLiteral, TSchema, TKind } from '@sinclair/typebox';
8
8
  import '@forklaunch/common';
@@ -22,7 +22,7 @@ declare class TypeboxSchemaValidator implements SchemaValidator$1<(<T extends TO
22
22
  email: _sinclair_typebox.TString;
23
23
  number: _sinclair_typebox.TTransform<TUnion<[_sinclair_typebox.TNumber, _sinclair_typebox.TString, _sinclair_typebox.TBoolean, _sinclair_typebox.TNull, _sinclair_typebox.TDate, _sinclair_typebox.TBigInt]>, number>;
24
24
  bigint: _sinclair_typebox.TTransform<TUnion<[_sinclair_typebox.TBigInt, _sinclair_typebox.TNumber, _sinclair_typebox.TString, _sinclair_typebox.TBoolean, _sinclair_typebox.TDate]>, bigint>;
25
- boolean: _sinclair_typebox.TTransform<TUnion<[_sinclair_typebox.TBoolean, _sinclair_typebox.TString]>, boolean | undefined>;
25
+ boolean: _sinclair_typebox.TTransform<TUnion<[_sinclair_typebox.TBoolean, _sinclair_typebox.TString]>, boolean>;
26
26
  date: _sinclair_typebox.TTransform<TUnion<[_sinclair_typebox.TDate, _sinclair_typebox.TNumber, _sinclair_typebox.TString, _sinclair_typebox.TBoolean, _sinclair_typebox.TNull]>, Date>;
27
27
  symbol: _sinclair_typebox.TSymbol;
28
28
  nullish: TUnion<[_sinclair_typebox.TVoid, _sinclair_typebox.TNull, _sinclair_typebox.TUndefined]>;
@@ -144,7 +144,7 @@ declare const bigint: _sinclair_typebox.TTransform<_sinclair_typebox.TUnion<[_si
144
144
  /**
145
145
  * TypeBox schema definition for boolean type.
146
146
  */
147
- declare const boolean: _sinclair_typebox.TTransform<_sinclair_typebox.TUnion<[_sinclair_typebox.TBoolean, _sinclair_typebox.TString]>, boolean | undefined>;
147
+ declare const boolean: _sinclair_typebox.TTransform<_sinclair_typebox.TUnion<[_sinclair_typebox.TBoolean, _sinclair_typebox.TString]>, boolean>;
148
148
  /**
149
149
  * TypeBox schema definition for date type.
150
150
  */
@@ -2,7 +2,7 @@ import * as openapi3_ts_oas31 from 'openapi3-ts/oas31';
2
2
  import { SchemaObject } from 'openapi3-ts/oas31';
3
3
  import * as _sinclair_typebox_compiler from '@sinclair/typebox/compiler';
4
4
  import { TypeCheck } from '@sinclair/typebox/compiler';
5
- import { S as SchemaValidator$1, T as TObject, f as TIdiomaticSchema, g as TResolve, h as TUnionContainer, i as UnionTResolve, L as LiteralSchema, a as ParseResult } from '../../schema.types-Do9dhcdB.js';
5
+ import { S as SchemaValidator$1, T as TObject, f as TIdiomaticSchema, g as TResolve, h as TUnionContainer, i as UnionTResolve, L as LiteralSchema, a as ParseResult } from '../../schema.types-CA4Aof4g.js';
6
6
  import * as _sinclair_typebox from '@sinclair/typebox';
7
7
  import { TProperties, TOptional, TArray, TUnion, TLiteral, TSchema, TKind } from '@sinclair/typebox';
8
8
  import '@forklaunch/common';
@@ -22,7 +22,7 @@ declare class TypeboxSchemaValidator implements SchemaValidator$1<(<T extends TO
22
22
  email: _sinclair_typebox.TString;
23
23
  number: _sinclair_typebox.TTransform<TUnion<[_sinclair_typebox.TNumber, _sinclair_typebox.TString, _sinclair_typebox.TBoolean, _sinclair_typebox.TNull, _sinclair_typebox.TDate, _sinclair_typebox.TBigInt]>, number>;
24
24
  bigint: _sinclair_typebox.TTransform<TUnion<[_sinclair_typebox.TBigInt, _sinclair_typebox.TNumber, _sinclair_typebox.TString, _sinclair_typebox.TBoolean, _sinclair_typebox.TDate]>, bigint>;
25
- boolean: _sinclair_typebox.TTransform<TUnion<[_sinclair_typebox.TBoolean, _sinclair_typebox.TString]>, boolean | undefined>;
25
+ boolean: _sinclair_typebox.TTransform<TUnion<[_sinclair_typebox.TBoolean, _sinclair_typebox.TString]>, boolean>;
26
26
  date: _sinclair_typebox.TTransform<TUnion<[_sinclair_typebox.TDate, _sinclair_typebox.TNumber, _sinclair_typebox.TString, _sinclair_typebox.TBoolean, _sinclair_typebox.TNull]>, Date>;
27
27
  symbol: _sinclair_typebox.TSymbol;
28
28
  nullish: TUnion<[_sinclair_typebox.TVoid, _sinclair_typebox.TNull, _sinclair_typebox.TUndefined]>;
@@ -144,7 +144,7 @@ declare const bigint: _sinclair_typebox.TTransform<_sinclair_typebox.TUnion<[_si
144
144
  /**
145
145
  * TypeBox schema definition for boolean type.
146
146
  */
147
- declare const boolean: _sinclair_typebox.TTransform<_sinclair_typebox.TUnion<[_sinclair_typebox.TBoolean, _sinclair_typebox.TString]>, boolean | undefined>;
147
+ declare const boolean: _sinclair_typebox.TTransform<_sinclair_typebox.TUnion<[_sinclair_typebox.TBoolean, _sinclair_typebox.TString]>, boolean>;
148
148
  /**
149
149
  * TypeBox schema definition for date type.
150
150
  */
@@ -147,7 +147,7 @@ var TypeboxSchemaValidator = class {
147
147
  ).Decode((value) => {
148
148
  if (typeof value === "string") {
149
149
  if (value.toLowerCase() === "true") return true;
150
- if (value.toLowerCase() === "false") return false;
150
+ return false;
151
151
  } else {
152
152
  return value;
153
153
  }
@@ -106,7 +106,7 @@ var TypeboxSchemaValidator = class {
106
106
  ).Decode((value) => {
107
107
  if (typeof value === "string") {
108
108
  if (value.toLowerCase() === "true") return true;
109
- if (value.toLowerCase() === "false") return false;
109
+ return false;
110
110
  } else {
111
111
  return value;
112
112
  }
@@ -1,5 +1,5 @@
1
1
  import * as openapi3_ts_oas31 from 'openapi3-ts/oas31';
2
- import { Z as ZodSchemaValidator, j as ZodIdiomaticSchema, k as ZodResolve, l as ZodUnionContainer, m as UnionZodResolve, L as LiteralSchema, n as ZodCatchall, a as ParseResult } from '../../schema.types-Do9dhcdB.mjs';
2
+ import { Z as ZodSchemaValidator, j as ZodIdiomaticSchema, k as ZodResolve, l as ZodUnionContainer, m as UnionZodResolve, L as LiteralSchema, n as ZodCatchall, a as ParseResult } from '../../schema.types-CA4Aof4g.mjs';
3
3
  import * as zod from 'zod';
4
4
  import '@forklaunch/common';
5
5
  import '@sinclair/typebox';
@@ -1,5 +1,5 @@
1
1
  import * as openapi3_ts_oas31 from 'openapi3-ts/oas31';
2
- import { Z as ZodSchemaValidator, j as ZodIdiomaticSchema, k as ZodResolve, l as ZodUnionContainer, m as UnionZodResolve, L as LiteralSchema, n as ZodCatchall, a as ParseResult } from '../../schema.types-Do9dhcdB.js';
2
+ import { Z as ZodSchemaValidator, j as ZodIdiomaticSchema, k as ZodResolve, l as ZodUnionContainer, m as UnionZodResolve, L as LiteralSchema, n as ZodCatchall, a as ParseResult } from '../../schema.types-CA4Aof4g.js';
3
3
  import * as zod from 'zod';
4
4
  import '@forklaunch/common';
5
5
  import '@sinclair/typebox';
@@ -75,7 +75,7 @@ var ZodSchemaValidator = class {
75
75
  boolean = import_zod.z.preprocess((val) => {
76
76
  if (typeof val === "string") {
77
77
  if (val.toLowerCase() === "true") return true;
78
- if (val.toLowerCase() === "false") return false;
78
+ return false;
79
79
  }
80
80
  return val;
81
81
  }, import_zod.z.boolean());
@@ -29,7 +29,7 @@ var ZodSchemaValidator = class {
29
29
  boolean = z.preprocess((val) => {
30
30
  if (typeof val === "string") {
31
31
  if (val.toLowerCase() === "true") return true;
32
- if (val.toLowerCase() === "false") return false;
32
+ return false;
33
33
  }
34
34
  return val;
35
35
  }, z.boolean());
@@ -1,5 +1,5 @@
1
1
  import { SchemaObject } from 'openapi3-ts/oas31';
2
- import { S as SchemaValidator, L as LiteralSchema, a as ParseResult } from '../../schema.types-Do9dhcdB.mjs';
2
+ import { S as SchemaValidator, L as LiteralSchema, a as ParseResult } from '../../schema.types-CA4Aof4g.mjs';
3
3
  import '@forklaunch/common';
4
4
  import '@sinclair/typebox';
5
5
  import '@sinclair/typebox/compiler';
@@ -1,5 +1,5 @@
1
1
  import { SchemaObject } from 'openapi3-ts/oas31';
2
- import { S as SchemaValidator, L as LiteralSchema, a as ParseResult } from '../../schema.types-Do9dhcdB.js';
2
+ import { S as SchemaValidator, L as LiteralSchema, a as ParseResult } from '../../schema.types-CA4Aof4g.js';
3
3
  import '@forklaunch/common';
4
4
  import '@sinclair/typebox';
5
5
  import '@sinclair/typebox/compiler';
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@forklaunch/validator",
3
- "version": "0.4.3",
3
+ "version": "0.4.5",
4
4
  "description": "Schema validator for ForkLaunch components.",
5
5
  "homepage": "https://github.com/forklaunch/forklaunch-js#readme",
6
6
  "bugs": {
@@ -58,24 +58,24 @@
58
58
  "lib"
59
59
  ],
60
60
  "dependencies": {
61
- "@anatine/zod-openapi": "^2.2.6",
62
- "@sinclair/typebox": "^0.34.14",
63
- "zod": "^3.24.1",
64
- "@forklaunch/common": "0.2.1"
61
+ "@anatine/zod-openapi": "^2.2.7",
62
+ "@sinclair/typebox": "^0.34.28",
63
+ "zod": "^3.24.2",
64
+ "@forklaunch/common": "0.2.2"
65
65
  },
66
66
  "devDependencies": {
67
- "@eslint/js": "^9.18.0",
67
+ "@eslint/js": "^9.22.0",
68
68
  "@types/jest": "^29.5.14",
69
- "@vitest/coverage-v8": "^3.0.2",
70
- "eslint-config-prettier": "^10.0.1",
71
- "eslint-plugin-prettier": "^5.2.2",
72
- "globals": "^15.14.0",
69
+ "@vitest/coverage-v8": "^3.0.8",
70
+ "eslint-config-prettier": "^10.1.1",
71
+ "eslint-plugin-prettier": "^5.2.3",
72
+ "globals": "^16.0.0",
73
73
  "jest": "^29.7.0",
74
74
  "openapi3-ts": "^4.4.0",
75
- "ts-jest": "^29.2.5",
75
+ "ts-jest": "^29.2.6",
76
76
  "ts-node": "^10.9.2",
77
- "tsup": "^8.3.5",
78
- "typescript-eslint": "^8.20.0"
77
+ "tsup": "^8.4.0",
78
+ "typescript-eslint": "^8.26.0"
79
79
  },
80
80
  "scripts": {
81
81
  "build": "tsc --noEmit && tsup index.ts src/typebox/index.ts src/zod/index.ts tests/utils/mockSchemaValidator.ts --format cjs,esm --no-splitting --tsconfig tsconfig.json --outDir lib --dts --clean",