UNPKG

dynamodb-toolbox

Version:

Lightweight and type-safe query builder for DynamoDB and TypeScript.

12 lines (11 loc) 782 B
import { z } from 'zod'; import type { ListSchema } from '../../../../schema/index.js'; import type { Overwrite } from '../../../../types/overwrite.js'; import type { WithValidate } from '../utils.js'; import type { SchemaZodParser } from './schema.js'; import type { ZodParserOptions } from './types.js'; import type { WithDefault, WithOptional } from './utils.js'; export type ListZodParser<SCHEMA extends ListSchema, OPTIONS extends ZodParserOptions = {}> = ListSchema extends SCHEMA ? z.ZodTypeAny : WithDefault<SCHEMA, OPTIONS, WithOptional<SCHEMA, OPTIONS, WithValidate<SCHEMA, z.ZodArray<SchemaZodParser<SCHEMA['elements'], Overwrite<OPTIONS, { defined: true; }>>>>>>; export declare const listZodParser: (schema: ListSchema, options?: ZodParserOptions) => z.ZodTypeAny;