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

same-data

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

same-data

Deep equal with no deps and only for 'data' objects, ie basic objects, arrays, primitives and typed arrays

  • 1.0.0
  • latest
  • Source
  • npm
  • Socket score

Version published
Maintainers
1
Created
Source

same-data

Deep equal with no deps and only for "data" objects, ie basic objects, arrays, primitives and typed arrays

npm install same-data

Designed to be simple and for data. Does NOT do anything magic for functions, symbols, recursive objects

Usage

const sameData = require('same-data')

console.log(sameData(1, 1)) // true
console.log(sameData(1, 2)) // false
console.log(sameData({ foo: 1 }, { foo: 1 })) // true
console.log(sameData({ foo: 1 }, { foo: 1, bar: true })) // false
console.log(sameData({ foo: 1, nested: { a: 1 } }, { foo: 1, nested: { a: 1 } })) // true
console.log(sameData([{ a: 1 }, { b: 1 }], [{ a: 1 }, { b: 1 }])) // true

License

MIT

FAQs

Package last updated on 05 Oct 2022

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

  • 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