Skip to content

ChristoPy/mergedeep

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

7 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Merge Deep

Merge objects properties with ease.

Installation

npm install @christopy/mergedeep

Importing

const mergedeep = require("@christopy/mergedeep");

Running

Code:

// Setup base structure
const me = {
  name: "chris",
  age: 23,
  freelancer: false,
  coding: {
    since: 12,
    technologies: ["node", "vue", "typescript", "sass/scss"],
  },
};

// Configure new data
const newInformation = {
  freelancer: true,
  loves: ["coding", "design", "music"],
  coding: {
    technologies: ["python", "node"],
  },
};

// Merge new data with the base structure
const result = mergedeep(me, newInformation);
console.log(result);
/*
{
  "name": "chris",
  "age": 20,
  "coding": {
    "since": 12,
    "technologies": [
      "node",
      "vue",
      "typescript",
      "sass/scss",
      "python",
      "node"
    ]
  },
  "freelancer": true,
  "loves": [
    "coding",
    "design",
    "music"
  ]
}*/

Version

1.0.4

About

Merge objects properties with ease.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published