Skip to content

EntriesSpec

A specification for a set of entries.

Type Parameters

E extends EntriesSchema

Properties

schema

readonly schema: E

The schema for this set of entries. This is public so that it can be used to create new schemas, but the object is frozen and so cannot be mutated.

Defined in

packages/podspec/src/parse/entries.ts:109

Methods

parse()

parse(input, options, path): EntriesOutputType<E>

As safeParse but will throw an exception if errors are encountered.

Parameters

input: Record<string, null | string | number | bigint | boolean | PODValue | Date | Uint8Array>

options: EntriesParseOptions<E> = DEFAULT_ENTRIES_PARSE_OPTIONS

path: string[] = []

Returns

EntriesOutputType<E>

Defined in

packages/podspec/src/parse/entries.ts:150


safeParse()

safeParse(input, options, path): ParseResult<EntriesOutputType<E>>

Parse entries without throwing an exception.

Parameters

input: Record<string, null | string | number | bigint | boolean | PODValue | Date | Uint8Array>

A record of string keys to PODValues, strings, bigints or numbers.

options: EntriesParseOptions<E> = DEFAULT_ENTRIES_PARSE_OPTIONS

Options controlling how parsing of entries is performed.

path: string[] = []

The path leading to this object.

Returns

ParseResult<EntriesOutputType<E>>

A ParseResult containing either a valid result or list of issues.

Defined in

packages/podspec/src/parse/entries.ts:136


create()

static create<E>(schema): EntriesSpec<E>

Creates an EntriesSpec object from a given schema.

Type Parameters

E extends Readonly<Record<string, EntrySchema>>

Parameters

schema: E

The schema to use for this set of entries.

Returns

EntriesSpec<E>

A new EntriesSpec object

Defined in

packages/podspec/src/parse/entries.ts:182