Introducing Socket Firewall: Free, Proactive Protection for Your Software Supply Chain.Learn More
Socket
Book a DemoInstallSign in
Socket

array-map-sorted

Package Overview
Dependencies
Maintainers
1
Versions
6
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

array-map-sorted

Compare two sorted arrays, and map the items of the first map to matched ones.

Source
npmnpm
Version
1.2.1
Version published
Weekly downloads
127
135.19%
Maintainers
1
Weekly downloads
 
Created
Source

Build Status Coverage

array-map-sorted

Compare two sorted arrays, and map the items of the first map to matched ones.

Install

$ npm install array-map-sorted

Usage

import map from 'array-map-sorted'

map(
  [
    // 1 matches 4
    1,
    // 2 starts to match from 5 (4 has already been matched), and no matches
    2,
    // 3 starts to match from 5, and matches 9
    3
  ],
  [4, 5, 7, 9],
  (a, b) => b % a === 0
)

// [4, undefined, 9]

map(array, relative, mapper, defaultValue = 1)

Returns Array

License

MIT

Keywords

array-map-sorted

FAQs

Package last updated on 27 Nov 2017

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