Have ideas to improve npm?Join in the discussion! »

    just-filter-object
    TypeScript icon, indicating that this package has built-in type declarations

    1.3.0 • Public • Published

    just-filter-object

    Part of a library of zero-dependency npm modules that do just do one thing.
    Guilt-free utilities for every occasion.

    Try it now

    import filter from 'just-filter';
    
    // returns a new object containing those original properties for which the predicate returns truthy
    filter({a: 3, b: 5, c: 9}, (key, value) => value < 6); // {a: 3, b: 5}
    filter({a1: 3, b1: 5, a2: 9}, (key, value) => key[0] == 'a'); // {a1: 3, a2: 9}
    filter({a: 3, b: 5, c: null}, (key, value) => value); // {a: 3, b: 5}

    Install

    npm i just-filter-object

    DownloadsWeekly Downloads

    816

    Version

    1.3.0

    License

    MIT

    Unpacked Size

    3.9 kB

    Total Files

    6

    Last publish

    Collaborators

    • avatar