Skip to content

@pumpkin-plugins/config API / clone / cloneConfigValue

Function: cloneConfigValue() ​

cloneConfigValue<T>(value): T

Defined in: tools/config/src/clone.ts:11

Copies supported config values without using structuredClone, which isn't available in every plugin runtime. Plain tables and dense ordinary arrays are copied recursively, dates are copied by value, and root undefined is retained as the optional-default sentinel.

Type Parameters ​

T ​

T

Parameters ​

value ​

T

A config default to copy, or undefined for an optional field.

Returns ​

T

An independent value with the same TOML data.

Throws ​

When the value contains an invalid date, unsupported data, a cycle, or an unsupported object type.

pumpkin-plugins documentation