@fvilers/are-same
TypeScript icon, indicating that this package has built-in type declarations

2.0.0 • Public • Published

@fvilers/are-same

A TypeScript helper function that compare arguments for sameness

Installation

npm install @fvilers/are-same

or

yarn add @fvilers/are-same

ECMAScript module

Starting with version 2.0.0, this library will be published as an ECMAScript module.

Usage

import { areSame } from "@fvilers/are-same";

const x = {
  dob: new Date(2022, 5, 1, 9, 34),
  foo: "bar",
  n: 42,
  score: { values: [0, 1, 1, 2, 3, 5] },
};
const y = {
  dob: new Date(2022, 5, 1, 9, 34),
  foo: "bar",
  n: 42,
  score: { values: [0, 1, 1, 2, 3, 5] },
};

console.log("'x' and 'y' are", areSame(x, y) ? "the same" : "different");
'x' and 'y' are the same

Package Sidebar

Install

npm i @fvilers/are-same

Weekly Downloads

0

Version

2.0.0

License

MIT

Unpacked Size

20.2 kB

Total Files

11

Last publish

Collaborators

  • fvilers