@cahmoraes93/deep-strict-equal
TypeScript icon, indicating that this package has built-in type declarations

1.1.1 • Public • Published

Motivation

This package perform deep strict equal between data structures.

Usage

import { deepStrictEqual } from '@cahmoraes93/deep-strict-equal'

deepStrictEqual({ foo: { bar: [1, 2] } }, { foo: { bar: [1, 2] } })
//=> true

deepStrictEqual({ foo: { bar: [1, 2] } }, { foo: { bar: [1, 4] } })
//=> false

deepStrictEqual({ foo: { bar: 1 } }, { foo: { bar: 1 } })
//=> true

deepStrictEqual({ foo: { bar: 1 } }, { foo: { bar: '1' } })
//=> false

## Map

const map_1 = new Map().set('name', 'caique')
const map_2 = new Map().set('name', 'caique')

deepStrictEqual(map_1, map_2)
//=> true

const map_1 = new Map().set('name', 'caique')
const map_2 = new Map().set('name', 'thomas')

deepStrictEqual(map_1, map_2)
//=> false

## Set
const set_1 = new Set().add(1)
const set_2 = new Set().add(1, 2)

deepStrictEqual(set_1, set_2)
//=> false

Package Sidebar

Install

npm i @cahmoraes93/deep-strict-equal

Weekly Downloads

1

Version

1.1.1

License

MIT

Unpacked Size

44.8 kB

Total Files

18

Last publish

Collaborators

  • cahmoraes93