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:44function cloneJSONValue(value: unknown, path: string = '$'): JSONValueValidate and clone an unknown value into JSON-safe data. Only primitives, dense arrays, and plain objects with data properties are accepted.
Parameters
| Name | Type | Description |
|---|---|---|
| value | unknown | Value to validate and clone. |
| path | stringDefault: '$' | Location used in validation errors. |
Returns
JSONValue
A detached JSON-compatible copy of the value.