Skip to content

With this package it is available to compare Objects and Arrays

Notifications You must be signed in to change notification settings

hemae/hans-obj-comparator

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

hans-obj-comparator

With this package it is available to compare Objects and Arrays

Table of contents

Installing

Add the package to your project

npm i hans-obj-comparator

using yarn

yarn add hans-obj-comparator

Example

Export compareObjects or compareArrays from hans-obj-comparator

const {compareObjects, compareArrays} = require('hans-obj-comparator')

using TypeScript

import {compareObjects, compareArrays} from 'hans-obj-comparator'
console.log(compareObjects({a: 2, b: [1, 2, 4]}, {a: 2, b: [1, 2, 4]})) // true
console.log(compareObjects({a: 2, b: [8, 2, 4]}, {a: 2, b: [1, 2, 4]})) // false
console.log(compareObjects({a: 2, name: 3}, {a: 2, b: 3})) // false

console.log(compareArrays([{a: 123, b: 2}, {a: 1, b: -2}], [{a: 123, b: 2}, {a: 1, b: -2}])) // true
console.log(compareArrays([1, 2], [1, 2, 3])) // false
console.log(compareArrays([], [1, 2, 3])) // false

About

With this package it is available to compare Objects and Arrays

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published