1.0.1 • Published 1 year ago

@rikitonoto/map-equal v1.0.1

Weekly downloads
-
License
MIT
Repository
github
Last release
1 year ago

Description

This library allows you to compare the Map instances. but it is shallow compared, so can't compare nested objects.

Installation

npm install map-equal --save

Usage

import { mapEqual } from "map-equal";
mapEqual(new Map([[1,0]]), new Map([[1,0]])); // => true
mapEqual(new Map([[1,0]]), new Map([[1,1]])); // => false
mapEqual(new Map([[1,0]]), new Map([[2,0]])); // => false
mapEqual(new Map([["1",0]]), new Map([[1,0]])); // => false
mapEqual(new Map([[1,{}]]), new Map([[1,{}]])); // => false