Socket
Book a DemoInstallSign in
Socket

left-diff

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

left-diff

An array utility to calculate differences amongs arrays. Support array & nested array with string/number data

0.1.1
latest
npmnpm
Version published
Weekly downloads
3
50%
Maintainers
1
Weekly downloads
 
Created
Source

Left diff

An array utility to calculate differences amongs arrays. Support array & nested array with string/number data

Installation

npm install left-diff

Usage

leftDiff

returns a new array contains elements that are available in first array, but not in others

import { leftDiff } from 'left-diff'

leftDiff([1,2,3], [3,4,5])
// => [1,2]

leftDiff([1,2,3], [3,4,5], [1])
// => [2]

leftDiffDeep

returns a new array contains elements that are available in first array, but not in others - with all nested values counted

import { leftDiffDeep } from 'left-diff'

leftDiffDeep([1,[2,3]], [3,4,5])
// => [1,2]

leftDiffDeep([1,2,3], [[3,4],5], [1])
// => [2]

FAQs

Package last updated on 12 Jul 2025

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

SocketSocket SOC 2 Logo

Product

About

Packages

Stay in touch

Get open source security insights delivered straight into your inbox.

  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc

U.S. Patent No. 12,346,443 & 12,314,394. Other pending.