New Research: Supply Chain Attack on Axios Pulls Malicious Dependency from npm.Details →
Socket
Book a DemoSign in
Socket

mapover

Package Overview
Dependencies
Maintainers
1
Versions
5
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

mapover

functionally maps over multiple arrays at the same time

latest
Source
npmnpm
Version
1.0.0
Version published
Maintainers
1
Created
Source

mapover-js

This is a quick and simple little utility that allows you to map over more than one array at a time. I'm sure we've all had times where we're getting data from two different source and the indexes match up but we can't just use .map() on one and use the index of that to use on the other one. (Okay, just kidding. You can do exactly that.) But this is just one function that does it for you.

Examples

Codepen here

Usage

yarn add mapover
npm install mapover
const mapover = require('mapover').mapover;
import { mapover } from 'mapover';

var newArray = mapover(array1, array2[, array3...], function callback(arg1, arg2[, arg3...]) {
  // return element for newArray
});

Todo

  • Make better, more robust -- this is kind of vague... (maybe work with any iterable)
  • Implement reduce & filter
  • Options (or function) to feed it to know how to handle when the arrays are different lengths. Right now it just goes until the first array fed runs out.

FAQs

Package last updated on 19 Jan 2018

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts