Discord Player

cloneJSONValue

Validate and clone an unknown value into JSON-safe data. Only primitives, dense arrays, and plain objects with data properties are accepted.

You are reading the v8 docsDev
FunctionTypeScript@discord-player/plugin-host
View sourcepackages/plugin-host/src/utils/serialization.ts:44
function cloneJSONValue(value: unknown, path: string = '$'): JSONValue

Validate and clone an unknown value into JSON-safe data. Only primitives, dense arrays, and plain objects with data properties are accepted.

Parameters

NameTypeDescription
valueunknown

Value to validate and clone.

pathstringDefault: '$'

Location used in validation errors.

Returns

JSONValue

A detached JSON-compatible copy of the value.