Nocturnal Pumpkin Maelstrom

    @extra-map/zip.min
    TypeScript icon, indicating that this package has built-in type declarations

    2.2.15 • Public • Published

    Combines matching entries from maps. 📦 😺 🏃 📼 🌔 📜 📰 📘

    Similar: cartesianProduct, zip.

    This is part of package extra-map.

    This is browserified, minified version of @extra-map/zip.
    It is exported as global variable map_zip.
    CDN: unpkg, jsDelivr.


    map.zip(xs, [fm], [ft], [vd]);
    // xs: maps
    // fm: map function (vs, k)
    // ft: till function (dones) (some)
    // vd: default value
    const map = require("extra-map");
    const array = require("extra-array");
    
    var x = new Map([["a", 1], ["b", 2], ["c", 3]]);
    var y = new Map([["a", 10], ["b", 20]]);
    map.zip([x, y]);
    // Map(2) { "a" => [ 1, 10 ], "b" => [ 2, 20 ] } (shortest)
    
    map.zip([x, y], ([a, b]) => a + b);
    // Map(2) { "a" => 11, "b" => 22 }
    
    map.zip([x, y], null, array.some);
    // Map(2) { "a" => [ 1, 10 ], "b" => [ 2, 20 ] } (shortest)
    
    map.zip([x, y], null, array.every, 0);
    // Map(3) { "a" => [ 1, 10 ], "b" => [ 2, 20 ], "c" => [ 3, 0 ] } (longest)


    References

    Keywords

    Install

    npm i @extra-map/zip.min

    DownloadsWeekly Downloads

    1

    Version

    2.2.15

    License

    MIT

    Unpacked Size

    7.02 kB

    Total Files

    7

    Last publish

    Collaborators

    • wolfram77