Function isSuccess

  • This typed function is helpful in filtering out the successes from an array of results while preserving type information. For example:

    // type is ParserSuccess[]
    results.filter(isSuccess);

    // type is ParserResult[]
    results.filter(r => r.success);

    Type Parameters

    • T

    Parameters

    Returns result is ParserSuccess<T>

    • true if the result is a success, otherwise false

Generated using TypeDoc