How to use the multimap.Map function in multimap

To help you get started, we’ve selected a few multimap examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github KoryNunn / fastn / listComponent.js View on Github external
var MultiMap = require('multimap'),
    merge = require('flat-merge');

var requestIdleCallback = global.requestIdleCallback || global.requestAnimationFrame || global.setTimeout;

MultiMap.Map = Map;

function each(value, fn){
    if(!value || typeof value !== 'object'){
        return;
    }

    if(Array.isArray(value)){
        for(var i = 0; i < value.length; i++){
            fn(value[i], i)
        }
    }else{
        for(var key in value){
            fn(value[key], key);
        }
    }
}

multimap

multi-map which allow multiple values for the same key

MIT
Latest version published 4 years ago

Package Health Score

53 / 100
Full package analysis

Popular multimap functions