Tabnine Logo For Javascript
defaultsDeep
Code IndexAdd Tabnine to your IDE (free)

How to use
defaultsDeep
function
in
lodash

Best JavaScript code snippets using lodash.defaultsDeep(Showing top 15 results out of 315)

origin: nodejs/nodejs.org

// This function imports a given language file and uses the default language set
// in DEFAULT_LANG as a fallback to prevent any strings that aren't filled out
// from appearing as blank.
function i18nJSON (lang) {
 const defaultJSON = require(`./locale/${DEFAULT_LANG}/site.json`)
 const templateJSON = require(`./locale/${lang}/site.json`)

 return defaultsDeep({}, templateJSON, defaultJSON)
}
origin: moleculerjs/moleculer

created() {
    this.requests = new RequestStatistics(defaultsDeep({}, this.broker.options));
  }
origin: moleculerjs/moleculer

/**
   * Creates an instance of RequestStatistics.
   *
   * @param {any} options
   *
   * @memberof RequestStatistics
   */
  constructor(options) {
    this.options = defaultsDeep({}, options, {
      cycleTime: 5 * 1000,
      bucketCount: 12
    });

    this.total = new StatRequestStore("total", this.options.bucketCount);
    this.actions = new Map();

    this.cycleTimer = setInterval(() => {
      this.cycle();
    }, this.options.cycleTime);

    this.cycleTimer.unref();
  }
origin: moleculerjs/moleculer

opts = defaultsDeep(opts, {
origin: godaddy/gasket

/**
 * Loads config from presets and assigns to the main config.
 * Merge priority order being:
 * - loaded file config > preset configs > child preset configs
 *
 * @param {Gasket} gasket - Gasket engine instance
 */
function assignPresetConfig(gasket) {
 const { presets } = gasket.loader.loadConfigured(gasket.config.plugins);
 const presetConfigs = flattenPresets(presets).map(p => p.module && p.module.config).filter(Boolean);
 Object.assign(gasket.config, defaultsDeep(gasket.config, ...presetConfigs));
}
origin: godaddy/gasket

/**
  * Adds additional docsSetup for modules, merging duplicates with a first
  * in wins approach. When a module is then add to be configured, a docSetup
  * will be looked up from what's been added by plugins here.
  *
  * @param {Object.<string, DocsSetup>} moduleDocsSetup - Setups for modules
  * @private
  */
 _addModuleDocsSetup(moduleDocsSetup) {
  defaultsDeep(this._moduleDocsSetups, moduleDocsSetup);
 }
origin: wejs/we-core

/**
  * Get database connection configuration
  * @return {Object} database configs
  */
 getDBConnectionConfigs() {
  const dbC = this.we.config.database;

  let configs = dbC[this.env];


  if (!configs) {
   this.we.log.error(`Database configuration not found for enviroment: ${this.env}`);

   return this.we.exit( ()=> {
    process.exit();
   });
  }

  // set we.js core model definition configs
  defaultsDeep(configs, this.defaultModelDefinitionConfigs);

  // disable database logging by deffault
  if (!configs || !configs.logging) {
   configs.logging = false;
  }

  return configs;
 }
origin: venables/koa-plus

/**
 * Set default values for the `options` param if not set
 *
 * @param {Object} [options] - The options to use (optional)
 * @returns {Object} - The options object with default values
 */
function _defaults (options) {
 return defaultsDeep(options, {
  json: {
   pretty: process.env.NODE_ENV === 'development'
  },
  logger: {
   enabled: process.env.NODE_ENV !== 'test',
   format: process.env.NODE_ENV === 'development' ? 'dev' : 'common'
  }
 })
}
origin: RisingStack/trace-nodejs

test('should report crash', {
 timeout: TEST_TIMEOUT
}, function (t) {
 var server
 var app = express()
 app.use(bodyParser.json())
 app.post('/transaction-events', function (req, res) {
  try {
   t.ok(req.body.e, 'Events are reported')
   console.log(req.body.e)
   var event = find(req.body.e, function (e) {
    return e.t === 'err' && e.d.t === 'system-error'
   })
   t.ok(event != null, 'Error event exists')
   t.end()
  } finally {
   server.close()
  }
 })
 server = app.listen(TEST_WEB_SERVER_PORT, function (err) {
  t.error(err, 'server starts listening at ' + TEST_WEB_SERVER_PORT)

  spawnSync('node', [path.join(__dirname, 'testee.js')], {
   stdio: [0, 1, 2],
   env: defaultsDeep({}, env, process.env)
  })
 })
})
origin: godaddy/gasket

return defaultsDeep({},
 environments[envParts.slice(0, i + 1).join('.')],
 acc);
const devConfig = environments.development || environments.dev;
if (devConfig) {
 normalizedConfig = defaultsDeep({}, normalizedConfig, devConfig);
 const localOverrides = tryRequire(path.join(root, localFile));
 if (localOverrides) {
  normalizedConfig = defaultsDeep({}, localOverrides, normalizedConfig);
origin: RisingStack/trace-nodejs

} else {
 if (args.opts.isolate === 'child-process') {
  tape(name_, defaultsDeep(opts_, { timeout: 10000 }), function (t) {
   var testName
   if (args.name !== '(anonymous)') {
    testName = sha1.digest()
   var childEnv = defaultsDeep({
    TEST_NAME: testName,
    TEST_ISOLATE: 'child-process'
   if (spawnSync) {
    try {
     res = spawnSync(process.argv[0], process.argv.slice(1), defaultsDeep(
      { stdio: ['ignore', process.stdout, process.stderr] },
      args.opts.childProcessOpts,
     res = spawnSyncFallback(process.argv[0], process.argv.slice(1), defaultsDeep(
      { stdio: ['ignore', 'pipe', 'ignore'] },
      args.opts.childProcessOpts,
origin: godaddy/gasket

});
const windowConfig = defaultsDeep(config, {
 name: docsConfigSet.app.name
});
origin: godaddy/gasket

/**
 * Loads config from presets and assigns to the main config.
 * Merge priority order being:
 * - loaded file config > preset configs > child preset configs
 *
 * @param {Gasket} gasket - Gasket engine instance
 */
function assignPresetConfig(gasket) {
 const { presets } = gasket.loader.loadConfigured(gasket.config.plugins);
 const presetConfigs = flattenPresets(presets).map(p => p.module && p.module.config).filter(Boolean);
 Object.assign(gasket.config, defaultsDeep(gasket.config, ...presetConfigs));
}
origin: godaddy/gasket

/**
  * Adds additional docsSetup for modules, merging duplicates with a first
  * in wins approach. When a module is then add to be configured, a docSetup
  * will be looked up from what's been added by plugins here.
  *
  * @param {Object.<string, DocsSetup>} moduleDocsSetup - Setups for modules
  * @private
  */
 _addModuleDocsSetup(moduleDocsSetup) {
  defaultsDeep(this._moduleDocsSetups, moduleDocsSetup);
 }
origin: godaddy/gasket

return defaultsDeep({},
 environments[envParts.slice(0, i + 1).join('.')],
 acc);
const devConfig = environments.development || environments.dev;
if (devConfig) {
 normalizedConfig = defaultsDeep({}, normalizedConfig, devConfig);
 const localOverrides = tryRequire(path.join(root, localFile));
 if (localOverrides) {
  normalizedConfig = defaultsDeep({}, localOverrides, normalizedConfig);
lodash(npm)defaultsDeep

Most used lodash functions

  • LoDashStatic.map
    Creates an array of values by running each element in collection through iteratee. The iteratee is
  • LoDashStatic.isEmpty
    Checks if value is empty. A value is considered empty unless it’s an arguments object, array, string
  • LoDashStatic.forEach
    Iterates over elements of collection invoking iteratee for each element. The iteratee is invoked wit
  • LoDashStatic.find
    Iterates over elements of collection, returning the first element predicate returns truthy for.
  • LoDashStatic.pick
    Creates an object composed of the picked `object` properties.
  • LoDashStatic.get,
  • LoDashStatic.isArray,
  • LoDashStatic.filter,
  • LoDashStatic.merge,
  • LoDashStatic.isString,
  • LoDashStatic.isFunction,
  • LoDashStatic.assign,
  • LoDashStatic.extend,
  • LoDashStatic.includes,
  • LoDashStatic.keys,
  • LoDashStatic.cloneDeep,
  • LoDashStatic.uniq,
  • LoDashStatic.isObject,
  • LoDashStatic.omit

Popular in JavaScript

  • crypto
  • minimist
    parse argument options
  • http
  • bluebird
    Full featured Promises/A+ implementation with exceptionally good performance
  • glob
    a little globber
  • minimatch
    a glob matcher in javascript
  • request
    Simplified HTTP request client.
  • lodash
    Lodash modular utilities.
  • mime-types
    The ultimate javascript content-type utility.
  • Top plugins for Android Studio
Tabnine Logo
  • Products

    Search for Java codeSearch for JavaScript code
  • IDE Plugins

    IntelliJ IDEAWebStormVisual StudioAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimGoLandRubyMineEmacsJupyter NotebookJupyter LabRiderDataGripAppCode
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogTabnine AcademyTerms of usePrivacy policyJavascript Code Index
Get Tabnine for your IDE now