🚀 Socket Launch Week Day 5:Introducing Repository Access Permissions and Custom Roles.Learn more
Sign In

@ariestools/zod

Package Overview
Dependencies
Maintainers
1
Versions
2
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@ariestools/zod

Private workspace package consumed by @ariestools/sdk

latest
Source
npmnpm
Version
7.0.8
Version published
Maintainers
1
Created
Source

logo

@ariestools/zod

npm license

Base functionality used throughout XY Labs TypeScript/JavaScript libraries

Install

Using npm:

npm install {{name}}

Using yarn:

yarn add {{name}}

Using pnpm:

pnpm add {{name}}

Using bun:

bun add {{name}}

License

See the LICENSE file for license rights and limitations (LGPL-3.0-only).

Reference

packages

zod

### .temp-typedoc

  ### functions

    ### <a id="zodAllFactory"></a>zodAllFactory

@ariestools/zod

function zodAllFactory<T, TName>(zod, name): object;

Alpha

Creates a bundle of is, as, and to factory functions for a given zod schema.

Type Parameters

T

T

TName

TName extends string

Parameters

zod

ZodType<T>

The zod schema to validate against

name

TName

The name used to suffix the generated function names (e.g. 'Address' produces isAddress, asAddress, toAddress)

Returns

object

An object containing is<Name>, as<Name>, and to<Name> functions

    ### <a id="zodAsAsyncFactory"></a>zodAsAsyncFactory

@ariestools/zod

function zodAsAsyncFactory<TZod>(zod, name): {
<T>  (value): Promise<T & TZod | undefined>;
<T>  (value, assert): Promise<T & TZod>;
};

Creates an async function that validates a value against a zod schema and returns it with a narrowed type. Uses safeParseAsync for schemas with async refinements. When called without an assert config, returns undefined on failure.

Type Parameters

TZod

TZod

Parameters

zod

ZodType<TZod>

The zod schema to validate against

name

string

A name used in error messages for identification

Returns

An async function that validates and narrows the type of a value

{ <T> (value): Promise<T & TZod | undefined>; <T> (value, assert): Promise<T & TZod>; }

    ### <a id="zodAsFactory"></a>zodAsFactory

@ariestools/zod

function zodAsFactory<TZod>(zod, name): {
<T>  (value): T & TZod | undefined;
<T>  (value, assert): T & TZod;
};

Creates a function that validates a value against a zod schema and returns it with a narrowed type. When called without an assert config, returns undefined on failure. When called with an assert config, throws on failure.

Type Parameters

TZod

TZod

Parameters

zod

ZodType<TZod>

The zod schema to validate against

name

string

A name used in error messages for identification

Returns

A function that validates and narrows the type of a value

{ <T> (value): T & TZod | undefined; <T> (value, assert): T & TZod; }

    ### <a id="zodIsFactory"></a>zodIsFactory

@ariestools/zod

function zodIsFactory<TZod>(zod): <T>(value) => value is T & TZod;

Creates a type guard function that checks if a value matches a zod schema.

Type Parameters

TZod

TZod

Parameters

zod

ZodType<TZod>

The zod schema to validate against

Returns

A type guard function that returns true if the value passes validation

<T>(value) => value is T & TZod

    ### <a id="zodToAsyncFactory"></a>zodToAsyncFactory

@ariestools/zod

function zodToAsyncFactory<TZod>(zod, name): {
<T>  (value): Promise<T & TZod | undefined>;
<T>  (value, assert): Promise<T & TZod>;
};

Creates an async function that converts a value to the zod schema type, delegating to zodAsAsyncFactory internally. Provides overloads for optional assertion: without assert config resolves to undefined on failure, with assert config throws on failure.

Type Parameters

TZod

TZod

Parameters

zod

ZodType<TZod>

The zod schema to validate against

name

string

A name used in error messages for identification

Returns

An async function that validates and converts a value to the schema type

{ <T> (value): Promise<T & TZod | undefined>; <T> (value, assert): Promise<T & TZod>; }

    ### <a id="zodToFactory"></a>zodToFactory

@ariestools/zod

function zodToFactory<TZod>(zod, name): {
<T>  (value): T & TZod | undefined;
<T>  (value, assert): T & TZod;
};

Creates a function that converts a value to the zod schema type, delegating to zodAsFactory internally. Provides overloads for optional assertion: without assert config returns undefined on failure, with assert config throws on failure.

Type Parameters

TZod

TZod

Parameters

zod

ZodType<TZod>

The zod schema to validate against

name

string

A name used in error messages for identification

Returns

A function that validates and converts a value to the schema type

{ <T> (value): T & TZod | undefined; <T> (value, assert): T & TZod; }

  ### interfaces

    ### <a id="ZodFactoryConfigObject"></a>ZodFactoryConfigObject

@ariestools/zod

Configuration object for zod factory functions, providing a name for error messages.

Properties

name

name: string;
  ### type-aliases

    ### <a id="AllZodFactories"></a>AllZodFactories

@ariestools/zod

type AllZodFactories<TType, TName> = Record<`is${TName}`, ReturnType<typeof zodIsFactory>> & Record<`as${TName}`, ReturnType<typeof zodAsFactory>> & Record<`to${TName}`, ReturnType<typeof zodToFactory>>;

Alpha

Type Parameters

TType

TType

TName

TName extends string

    ### <a id="ZodFactoryConfig"></a>ZodFactoryConfig

@ariestools/zod

type ZodFactoryConfig = 
  | AssertConfig
  | ZodFactoryConfigObject;

Configuration for zod factory assertion behavior, either an AssertConfig or a named config object.

Credits

Made with 🔥 and ❄️ by XY Labs

FAQs

Package last updated on 05 Jul 2026

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts