Skip to content

@graphty/graphty-element / config / safeParseOptions

Function: safeParseOptions()

safeParseOptions<S>(optionsSchema, options): SafeParseResult<InferOptions<S>>

Defined in: src/config/OptionsSchema.ts:147

Safely parse options, returning a result object instead of throwing

Type Parameters

S

S extends OptionsSchema

Parameters

optionsSchema

S

Options schema to validate against

options

PartialOptions<S>

Partial options to parse and validate

Returns

SafeParseResult<InferOptions<S>>

Object with success flag and either data or error