Security News
tea.xyz Spam Plagues npm and RubyGems Package Registries
Tea.xyz, a crypto project aimed at rewarding open source contributions, is once again facing backlash due to an influx of spam packages flooding public package registries.
muggle-deep-equal
Advanced tools
Readme
A simple and generic implementation of deep equal using Iterables.
Used in muggle-assert, the assertion library for muggle
$ npm install muggle-deep-equal
const deepEqual = require('muggle-deep-equal')
// primitives are compared with ===
deepEqual('penguin', 'penguin') // returns true
deepEqual(100, 50) // returns false
deepEqual(1, true) // returns false
deepEqual([1, 2, 3, 4], [1, 2, 3, 4]) // returns true
deepEqual(
{
array: [1, 2, 3],
object: {
animal: 'penguin'
}
},
{
array: [1, 2, 3],
object: {
animal: 'penguin'
}
}
) // returns true
// if either string or array was different, deepEqual would return false
If two objects are deeply equal, then their actual data are equal rather than just their reference. It's useful for comparing separate instances of arrays and objects for example.
In muggle-deep-equal, equality is determined by these rules (in order):
===
String
, Number
, Boolean
, Function
, Symbol
, undefined
, or null
NaN
is considered equal to NaN
object1.constructor.name === object2.constructor.name
object.toString()
Error
, Date
, and RegExp
FAQs
A simple and generic implementation of deep equal
The npm package muggle-deep-equal receives a total of 1 weekly downloads. As such, muggle-deep-equal popularity was classified as not popular.
We found that muggle-deep-equal 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
Tea.xyz, a crypto project aimed at rewarding open source contributions, is once again facing backlash due to an influx of spam packages flooding public package registries.
Security News
As cyber threats become more autonomous, AI-powered defenses are crucial for businesses to stay ahead of attackers who can exploit software vulnerabilities at scale.
Security News
UnitedHealth Group disclosed that the ransomware attack on Change Healthcare compromised protected health information for millions in the U.S., with estimated costs to the company expected to reach $1 billion.