This is a
playground to test code. It runs a full
Node.js environment and already has all of
npm’s 400,000 packages pre-installed, including
merge-defaults with all
npm packages installed. Try it out:
This service is provided by RunKit and is not affiliated with npm, Inc or the package authors.
Implements a deep version of
This module DOES NOT merge arrays or dates.
$ npm install merge-defaults
var _ = require('lodash'); // Override basic `_.defaults` _.defaults = require('merge-defaults'); // Or you can add it as a new method _.mergeDefaults = require('merge-defaults');
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
_.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.
MIT © Mike McNeil 2014