UNPKG

parjs

Version:

A parser-combinator library for JavaScript.

12 lines (11 loc) 482 B
/** @module parjs/combinators */ /** */ import { ParjsCombinator } from "../../index"; /** * The type of an arbitrarily nested array or a non-array element. */ export declare type NestedArray<T> = T | T[] | T[][] | T[][][] | T[][][][] | T[][][][][] | T[][][][][][] | T[][][][][][][][]; /** * Applies the source parser and projects its result into a flat array - an array * with non-array elements. */ export declare function flatten<T>(): ParjsCombinator<NestedArray<T>, T[]>;