Skip to content
This repository has been archived by the owner on Aug 13, 2021. It is now read-only.
/ merge-defaults Public archive

A recursive version of `_.defaults`.

License

Notifications You must be signed in to change notification settings

balderdashy/merge-defaults

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

31 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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

About

A recursive version of `_.defaults`.

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Contributors 3

  •  
  •  
  •