1.0.2 • Published 2 years ago
deep-json-functions v1.0.2
json-deep-functions
Functions to create a deep copy of a JSON object and compare all values of JSON objects
Install via npm
$ npm i deep-json-functions
API
To include the package in your project you can use
const { deepCompareJSON, deepCloneJSON } = require('deep-json-functions')
or
import { deepCompareJSON, deepCloneJSON } from 'deep-json-functions'
Examples
//Import package
import { deepCompareJSON, deepCloneJSON } from 'deep-json-functions'
//Create a new Object
let obect1 = { entry1: true, entry2: 45, entry3: 'hello' };
//Copy the object without reference
let copyOfObect1 = deepCloneJSON(object1);
//Compare the two objects
console.log(deepCompareJSON(object1, copyOfObect1)); //true