Neurosis Prevention Mechanism

    @extra-iterable/pick

    1.1.1 • Public • Published

    Filter iterable with values of specified indexes, like _.pick().

    const pick = require('@extra-iterable/pick');
    // pick(<iterable>, <indexes>, [begin=0], [end], [target=[]], [at])
    
    pick(new Set(['Mountbatten', 'Manekshaw', 'Thimaya', 'Cariappa']), [3, 2]);
    // ['Cariappa', 'Thimaya']
    pick([1, 8, 6, 9], [3, 2], 1);
    // [9 ,6]
    pick([1, 8, 6, 9], [3, 2], 1, 3);
    // [<1 empty item>, 6]
    pick([1, 8, 6, 9], [3, 2], 1, 3, [10, 11]);
    // [10, 11, <1 empty item>, 6]
    pick([1, 8, 6, 9], [3, 2], 1, 3, [10, 11], 1);
    // [10, <1 empty item>, 6]

    extra-iterable

    Install

    npm i @extra-iterable/pick

    DownloadsWeekly Downloads

    0

    Version

    1.1.1

    License

    MIT

    Unpacked Size

    2.86 kB

    Total Files

    4

    Last publish

    Collaborators

    • wolfram77