Skip to content

@pumpkin-plugins/config API / read / readConfig

Function: readConfig() ​

readConfig<S>(schema, raw): ReadResult<ConfigValues<S>>

Defined in: tools/config/src/read.ts:51

Validates a parsed TOML document against a schema. Bad values fall back to their defaults; nothing throws.

Type Parameters ​

S ​

S extends ConfigSchema<Record<string, ConfigNode>>

Parameters ​

schema ​

S

The config schema.

raw ​

Record<string, unknown>

The parsed TOML document.

Returns ​

ReadResult<ConfigValues<S>>

The typed values and the issues found.

Pumpkin Plugins documentation