Socket
Socket
Sign inDemoInstall

merge-defaults

Package Overview
Dependencies
Maintainers
1
Versions
7
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

merge-defaults

A recursive version of _.defaults.


Version published
Weekly downloads
56K
decreased by-2.14%
Maintainers
1
Weekly downloads
 
Created
Source

Note: Lodash now includes a defaultsDeep function.

merge-defaults

Implements a deep version of _.defaults.

Important!

This module DOES NOT merge arrays or dates.

Installation

$ npm install merge-defaults

Usage


var _ = require('lodash');

// Override basic `_.defaults`
_.defaults = require('merge-defaults');

// Or you can add it as a new method
_.mergeDefaults = require('merge-defaults');

Why?

This module is a temporary solution, until lodash has something similar in core that can be called as a single method. In the mean time, this is a hack to make our code more readable. i.e. I know what _.defaults means intuitively, but I have to look up _.partialRight every time.

To get the latest status, see the original issue in the lodash repo.

I'll update this repo with install/version info if something comparable is added to lodash core at some point.

License

MIT © Mike McNeil 2014

Keywords

FAQs

Package last updated on 30 Apr 2019

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