Comparing version 1.2.18 to 1.2.19
@@ -5,3 +5,3 @@ import type { AnyElysia } from '.'; | ||
import type { ComposedHandler, Handler, HookContainer, LifeCycleStore, SchemaValidator } from './types'; | ||
import type { TypeCheck } from './type-system'; | ||
import { type TypeCheck } from './type-system'; | ||
export declare const hasAdditionalProperties: (_schema: TAnySchema | TypeCheck<any>) => any; | ||
@@ -8,0 +8,0 @@ export declare const hasType: (type: string, schema: TAnySchema) => any; |
@@ -517,3 +517,3 @@ "use strict"; | ||
} else { | ||
fnLiteral += `if(c.qi!==-1){let url = '&' + c.url.slice(c.qi + 1) | ||
fnLiteral += `if(c.qi!==-1){let url='&'+c.url.slice(c.qi + 1) | ||
`; | ||
@@ -520,0 +520,0 @@ let index = 0; |
@@ -310,3 +310,2 @@ "use strict"; | ||
const schema = t.Array(children, options); | ||
const defaultValue = JSON.stringify(import_value.Value.Create(schema)); | ||
let compiler; | ||
@@ -351,3 +350,3 @@ try { | ||
format: "ArrayString", | ||
default: defaultValue | ||
default: options?.default | ||
}), | ||
@@ -354,0 +353,0 @@ schema |
import type { BunFile } from 'bun'; | ||
import { TModule, type TSchema } from '@sinclair/typebox'; | ||
import { TAnySchema, TModule, type TSchema } from '@sinclair/typebox'; | ||
import { TypeCheck } from '@sinclair/typebox/compiler'; | ||
@@ -22,5 +22,6 @@ import type { Sucrose } from './sucrose'; | ||
from: TSchema; | ||
to(options: Object): TSchema; | ||
to(options: Object): TSchema | null; | ||
excludeRoot?: boolean; | ||
rootOnly?: boolean; | ||
original?: TAnySchema; | ||
/** | ||
@@ -27,0 +28,0 @@ * Traverse until object is found except root object |
@@ -230,6 +230,10 @@ "use strict"; | ||
const replaceSchemaType = (schema, options, root = true) => { | ||
if (!Array.isArray(options)) | ||
if (!Array.isArray(options)) { | ||
options.original = schema; | ||
return _replaceSchemaType(schema, options, root); | ||
for (const option of options) | ||
} | ||
for (const option of options) { | ||
option.original = schema; | ||
schema = _replaceSchemaType(schema, option, root); | ||
} | ||
return schema; | ||
@@ -266,2 +270,3 @@ }; | ||
const to = options.to(rest); | ||
if (!to) return schema; | ||
let transform; | ||
@@ -377,2 +382,3 @@ const composeProperties = (v) => { | ||
const to = options.to(rest); | ||
if (!to) return schema; | ||
if (to.anyOf) | ||
@@ -379,0 +385,0 @@ for (let i = 0; i < to.anyOf.length; i++) |
@@ -5,3 +5,3 @@ import type { AnyElysia } from '.'; | ||
import type { ComposedHandler, Handler, HookContainer, LifeCycleStore, SchemaValidator } from './types'; | ||
import type { TypeCheck } from './type-system'; | ||
import { type TypeCheck } from './type-system'; | ||
export declare const hasAdditionalProperties: (_schema: TAnySchema | TypeCheck<any>) => any; | ||
@@ -8,0 +8,0 @@ export declare const hasType: (type: string, schema: TAnySchema) => any; |
import type { BunFile } from 'bun'; | ||
import { TModule, type TSchema } from '@sinclair/typebox'; | ||
import { TAnySchema, TModule, type TSchema } from '@sinclair/typebox'; | ||
import { TypeCheck } from '@sinclair/typebox/compiler'; | ||
@@ -22,5 +22,6 @@ import type { Sucrose } from './sucrose'; | ||
from: TSchema; | ||
to(options: Object): TSchema; | ||
to(options: Object): TSchema | null; | ||
excludeRoot?: boolean; | ||
rootOnly?: boolean; | ||
original?: TAnySchema; | ||
/** | ||
@@ -27,0 +28,0 @@ * Traverse until object is found except root object |
{ | ||
"name": "elysia", | ||
"description": "Ergonomic Framework for Human", | ||
"version": "1.2.18", | ||
"version": "1.2.19", | ||
"author": { | ||
@@ -6,0 +6,0 @@ "name": "saltyAom", |
Sorry, the diff of this file is too big to display
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
1913970
30617