Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

array-missing

Package Overview
Dependencies
Maintainers
1
Versions
2
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

array-missing - npm Package Compare versions

Comparing version 1.0.0 to 1.1.0

13

index.js
module.exports = missing
function missing(expected, actual, missed) {
function noop() {}
function missing(expected, actual, missed, matched) {
var e = expected.length
var a = actual.length
missed = missed || noop
matched = matched || noop
out: for (var i = 0; i < e; i++) {
var ex = expected[i]
for (var j = 0; j < a; j++) {
if (expected[i] === actual[j]) {
if (ex === actual[j]) {
matched(ex, i)
continue out

@@ -14,4 +21,4 @@ }

missed(expected[i], i)
missed(ex, i)
}
}
{
"name": "array-missing",
"version": "1.0.0",
"version": "1.1.0",
"description": "Call a function for every element from a given array that's missing from another array",

@@ -5,0 +5,0 @@ "main": "index.js",

@@ -9,3 +9,3 @@ # array-missing [![unstable](http://badges.github.io/stability-badges/dist/unstable.svg)](http://github.com/badges/stability-badges)

### `missing(expected, actual, missed)`
### `missing(expected, actual, [missed], [matched])`

@@ -16,3 +16,4 @@ Checks every element in the `expected` array to see if it's present somewhere in

If an element isn't found, `missed(el, index)` will be called, where `el` is the
element that's missing and `index` is its index within `expected`.
element that's missing and `index` is its index within `expected`. Otherwise,
`matched` will be called with the same arguments.

@@ -19,0 +20,0 @@ For example:

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc