
Security News
GitHub Actions Pricing Whiplash: Self-Hosted Actions Billing Change Postponed
GitHub postponed a new billing model for self-hosted Actions after developer pushback, but moved forward with hosted runner price cuts on January 1.
array-map-sorted
Advanced tools
Compare two sorted arrays, and map the items of the first map to matched ones.
Compare two sorted arrays, and map the items of the first map to matched ones.
$ npm install array-map-sorted
import map from 'array-map-sorted'
const args = [
[
// 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
]
map(...args)
// [4, undefined, 9]
map(...args, 0)
// [4, 0, 9]
map(...args, 0, (datum, rel) => datum + rel)
// [5, 0, 12]
Array<datum> the array to be mappedArray<rel> which each datum of data will be matched with.function(datum, rel, datum_i, rel_i): boolean the matcher functionany=undefined if there is no match, the datum will be mapped to defaultValuefunction(datum, rel, datum_i, rel_i): any if there is a match, mapper returns the value which the datum to be mapped into. By default, mapper is (datum, rel) => rel.Returns Array
MIT
FAQs
Compare two sorted arrays, and map the items of the first map to matched ones.
The npm package array-map-sorted receives a total of 52 weekly downloads. As such, array-map-sorted popularity was classified as not popular.
We found that array-map-sorted demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?

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.

Security News
GitHub postponed a new billing model for self-hosted Actions after developer pushback, but moved forward with hosted runner price cuts on January 1.

Research
Destructive malware is rising across open source registries, using delays and kill switches to wipe code, break builds, and disrupt CI/CD.

Security News
Socket CTO Ahmad Nassri shares practical AI coding techniques, tools, and team workflows, plus what still feels noisy and why shipping remains human-led.