Skip to content

v2.2.0

Latest
Compare
Choose a tag to compare
@dphilipson dphilipson released this 10 Feb 19:06
· 2 commits to master since this release

New Features

  • Now takes TypeScript type guards into account when using filter, remove, takeWhile, and find. For example,

    function isNumber(x: unknown): x is number {
        return typeof x === "number";
    }
    
    chainFrom(["a", 1, "b", 2])
        .filter(isNumber)
        .toArray();
    // Return type inferred as number[], previously (string | number)[].

    Thanks to @icehaunter for the suggestion!