Skip to main content
Deno 2 is finally here 🎉️
Learn more
Module

x/valibot/src/index.ts>unwrap

The modular and type safe schema library for validating structural data 🤖
Extremely Popular
Latest
function unwrap
import { unwrap } from "https://deno.land/x/valibot@v1.0.0-beta.2-to-json-schema/src/index.ts";

Unwraps the wrapped schema.

Type Parameters

TSchema extends
| NonNullableSchema<BaseSchema<unknown, unknown, BaseIssue<unknown>>, ErrorMessage<NonNullableIssue> | undefined>
| NonNullableSchemaAsync<BaseSchema<unknown, unknown, BaseIssue<unknown>> | BaseSchemaAsync<unknown, unknown, BaseIssue<unknown>>, ErrorMessage<NonNullableIssue> | undefined>
| NonNullishSchema<BaseSchema<unknown, unknown, BaseIssue<unknown>>, ErrorMessage<NonNullishIssue> | undefined>
| NonNullishSchemaAsync<BaseSchema<unknown, unknown, BaseIssue<unknown>> | BaseSchemaAsync<unknown, unknown, BaseIssue<unknown>>, ErrorMessage<NonNullishIssue> | undefined>
| NonOptionalSchema<BaseSchema<unknown, unknown, BaseIssue<unknown>>, ErrorMessage<NonOptionalIssue> | undefined>
| NonOptionalSchemaAsync<BaseSchema<unknown, unknown, BaseIssue<unknown>> | BaseSchemaAsync<unknown, unknown, BaseIssue<unknown>>, ErrorMessage<NonOptionalIssue> | undefined>
| NullableSchema<BaseSchema<unknown, unknown, BaseIssue<unknown>>, unknown>
| NullableSchemaAsync<BaseSchema<unknown, unknown, BaseIssue<unknown>> | BaseSchemaAsync<unknown, unknown, BaseIssue<unknown>>, unknown>
| NullishSchema<BaseSchema<unknown, unknown, BaseIssue<unknown>>, unknown>
| NullishSchemaAsync<BaseSchema<unknown, unknown, BaseIssue<unknown>> | BaseSchemaAsync<unknown, unknown, BaseIssue<unknown>>, unknown>
| OptionalSchema<BaseSchema<unknown, unknown, BaseIssue<unknown>>, unknown>
| OptionalSchemaAsync<BaseSchema<unknown, unknown, BaseIssue<unknown>> | BaseSchemaAsync<unknown, unknown, BaseIssue<unknown>>, unknown>
| UndefinedableSchema<BaseSchema<unknown, unknown, BaseIssue<unknown>>, unknown>
| UndefinedableSchemaAsync<BaseSchema<unknown, unknown, BaseIssue<unknown>> | BaseSchemaAsync<unknown, unknown, BaseIssue<unknown>>, unknown>

Parameters

schema: TSchema

The schema to be unwrapped.

Returns

TSchema["wrapped"]

The unwrapped schema.