Latest Threat ResearchGlassWorm Loader Hits Open VSX via Developer Account Compromise.Details
Socket
Book a DemoInstallSign in
Socket

juliangruber-shallow-equal

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

juliangruber-shallow-equal

Minimalistic shallow equality check for arrays/objects

latest
Source
npmnpm
Version
1.0.4
Version published
Maintainers
1
Created
Source

Build Status Coverage Status bitHound Overall Score NPM Version

Description

If you know you have two arrays or two objects in hand, and you want to know if they are shallowly equal or not, this library is for you.

Features

  • Super light
  • No dependencies
  • Thoroughly tested

Installation

npm install shallow-equal --save

Usage

var shallowEqualArrays = require('shallow-equal/arrays');

shallowEqualArrays([1, 2, 3], [1, 2, 3])     // => true
shallowEqualArrays([{ a: 5 }], [{ a: 5 }])   // => false
var shallowEqualObjects = require('shallow-equal/objects');

shallowEqualObjects({ a: 5, b: 'abc' }, { a: 5, b: 'abc' })   // => true
shallowEqualObjects({ a: 5, b: {} }, { a: 5, b: {} })         // => false

License

MIT

Keywords

shallow

FAQs

Package last updated on 22 May 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