Skip to content

Function: parseAsStringLiteral() ​

ts
function parseAsStringLiteral<T>(values): Parser<T[number]>;

Defined in: parser/parsers.ts:159

Accepts only the strings listed, and reads them as their union.

Type Parameters ​

Type Parameter
T extends readonly string[]

Parameters ​

ParameterType
valuesT

Returns ​

Parser<T[number]>

Released under the MIT License.