跳转到内容

utils/jsonUtils

此内容尚不支持你的语言。

function jsonParse<T>(text: string): T

Defined in: studiocms/packages/studiocms/src/utils/jsonUtils.ts:11^

Parses a JSON string and returns the resulting object.

T extends object

The expected type of the parsed object.

string

The JSON string to parse.

T

The parsed object of type T.

If the input string is not valid JSON.


function readJson<T>(path: string | URL): T

Defined in: studiocms/packages/studiocms/src/utils/jsonUtils.ts:18^

Reads a JSON file and parses it into an object of type T.

T extends object

string | URL

T