Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@jalik/deep-extend

Package Overview
Dependencies
Maintainers
1
Versions
21
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@jalik/deep-extend

A utility to merge deep objects.

  • 1.0.0
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
211
decreased by-46.31%
Maintainers
1
Weekly downloads
 
Created
Source

@jalik/deep-extend

A utility to merge deep objects.

Introduction

Use it when you need to merge nested objects.

This library has been unit tested.

Merging deep objects

The following code shows how to merge objects without losing values that are not defined in objects to merge.

import deepExtend from "@jalik/deep-extend";

const defaultColors = {
    cold: {
        blue: "#0000FF",
        green: "#00FF00"
    },
    hot: {
        red: "#FF0000",
        yellow: "#FFFF00"
    }
};

const customColors = {
    cold: {
        blue: "#48C2ED"
    },
    hot: {
        yellow: "#E6CB5F"
    }
};

// Merge all colors into a new object.
// The final colors will have custom blue and yellow colors,
// but the other colors will be the default ones.
const finalColors = deepExtend({}, defaultColors, customColors);

Changelog

History of releases is in the changelog.

License

The code is released under the MIT License.

Keywords

FAQs

Package last updated on 13 Oct 2018

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc