Skip to content

Latest commit

 

History

History
25 lines (15 loc) · 702 Bytes

prsc.map.md

File metadata and controls

25 lines (15 loc) · 702 Bytes

Home > prsc > map

map() function

Creates a Parser that applies the given function to each value generated by the given parser.

Signature:

export declare function map<T, U>(parser: Parser<T>, map: (v: T) => U): Parser<U>;

Parameters

Parameter Type Description
parser Parser<T> Parser to map over
map (v: T) => U Function to transform values generated by parser

Returns:

Parser<U>