Skip to content

Graphorin API reference v0.1.0


Graphorin API reference / @graphorin/core / / validate

Function: validate()

ts
function validate<T>(schema, data): ValidationResult<T>;

Defined in: packages/core/src/utils/validation.ts:51

Synchronous validation wrapper. Does not swallow errors thrown by the schema's transformations — only normalizes the success / failure signal.

Type Parameters

Type Parameter
T

Parameters

ParameterType
schemaZodLikeSchema&lt;T&gt;
dataunknown

Returns

ValidationResult&lt;T&gt;

Stable