Skip to content

@pumpkin-plugins/static-hermes-runtime API / cli / parseJsonStringArray

Function: parseJsonStringArray() ​

parseJsonStringArray(json, optionName, itemDescription): string[] | undefined

Defined in: cli.ts:129

Parse and deduplicate one JSON string-array CLI value.

Parameters ​

json ​

string | undefined

JSON text supplied to an option, or undefined when it was omitted.

optionName ​

string

CLI option name used in validation errors, without the leading --.

itemDescription ​

string

Human-readable name for the required array item type.

Returns ​

string[] | undefined

Unique strings in their original order, or undefined for an omitted option.

Throws ​

If the value is not valid JSON or is not an array of strings.

pumpkin-plugins documentation