How to use the deep-extend.apply function in deep-extend

To help you get started, we’ve selected a few deep-extend examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github armthethinker / webVR-experiments / node_modules / bower / lib / node_modules / rc / index.js View on Github external
}

  // which files do we look at?
  if (!win)
   [join(etc, name, 'config'),
    join(etc, name + 'rc')].forEach(addConfigFile)
  if (home)
   [join(home, '.config', name, 'config'),
    join(home, '.config', name),
    join(home, '.' + name, 'config'),
    join(home, '.' + name + 'rc')].forEach(addConfigFile)
  addConfigFile(cc.find('.'+name+'rc'))
  if (env.config) addConfigFile(env.config)
  if (argv.config) addConfigFile(argv.config)

  return deepExtend.apply(null, configs.concat([
    env,
    argv,
    configFiles.length ? {configs: configFiles, config: configFiles[configFiles.length - 1]} : null,
  ]))
}
github devinhalladay / devinhalladay.com / node_modules / rc / index.js View on Github external
}

  // which files do we look at?
  if (!win)
   [join(etc, name, 'config'),
    join(etc, name + 'rc')].forEach(addConfigFile)
  if (home)
   [join(home, '.config', name, 'config'),
    join(home, '.config', name),
    join(home, '.' + name, 'config'),
    join(home, '.' + name + 'rc')].forEach(addConfigFile)
  addConfigFile(cc.find('.'+name+'rc'))
  if (env.config) addConfigFile(env.config)
  if (argv.config) addConfigFile(argv.config)

  return deepExtend.apply(null, configs.concat([
    env,
    argv,
    configFiles.length ? {configs: configFiles, config: configFiles[configFiles.length - 1]} : undefined,
  ]))
}
github sx1989827 / DOClever / Desktop / node_modules / fsevents / node_modules / rc / index.js View on Github external
}

  // which files do we look at?
  if (!win)
   [join(etc, name, 'config'),
    join(etc, name + 'rc')].forEach(addConfigFile)
  if (home)
   [join(home, '.config', name, 'config'),
    join(home, '.config', name),
    join(home, '.' + name, 'config'),
    join(home, '.' + name + 'rc')].forEach(addConfigFile)
  addConfigFile(cc.find('.'+name+'rc'))
  if (env.config) addConfigFile(env.config)
  if (argv.config) addConfigFile(argv.config)

  return deepExtend.apply(null, configs.concat([
    env,
    argv,
    configFiles.length ? {configs: configFiles, config: configFiles[configFiles.length - 1]} : undefined,
  ]))
}
github GoogleContainerTools / kpt / docsy / node_modules / fsevents / node_modules / rc / index.js View on Github external
}

  // which files do we look at?
  if (!win)
   [join(etc, name, 'config'),
    join(etc, name + 'rc')].forEach(addConfigFile)
  if (home)
   [join(home, '.config', name, 'config'),
    join(home, '.config', name),
    join(home, '.' + name, 'config'),
    join(home, '.' + name + 'rc')].forEach(addConfigFile)
  addConfigFile(cc.find('.'+name+'rc'))
  if (env.config) addConfigFile(env.config)
  if (argv.config) addConfigFile(argv.config)

  return deepExtend.apply(null, configs.concat([
    env,
    argv,
    configFiles.length ? {configs: configFiles, config: configFiles[configFiles.length - 1]} : undefined,
  ]))
}
github hegemonic / jsdoc-baseline / lib / template.js View on Github external
let l10nFiles;

        try {
            l10nFiles = lsSync(this.config.l10n, 0);
        } catch (e) {
            logger.fatal(`Unable to find the localization data file ${this.config.l10nFile}`);

            return this;
        }

        l10nFiles.forEach(filepath => {
            l10nData.push(loadYaml(filepath));
        });

        // Merge the objects in reverse order so that the first one loaded wins.
        this._l10nData = deepExtend.apply(deepExtend, l10nData.reverse());
        this._l10nFormatter = new MessageFormat(this.locale).compile(this._l10nData);

        return this;
    }
github dominictarr / rc / index.js View on Github external
}

  // which files do we look at?
  if (!win)
   [join(etc, name, 'config'),
    join(etc, name + 'rc')].forEach(addConfigFile)
  if (home)
   [join(home, '.config', name, 'config'),
    join(home, '.config', name),
    join(home, '.' + name, 'config'),
    join(home, '.' + name + 'rc')].forEach(addConfigFile)
  addConfigFile(cc.find('.'+name+'rc'))
  if (env.config) addConfigFile(env.config)
  if (argv.config) addConfigFile(argv.config)

  return deepExtend.apply(null, configs.concat([
    env,
    argv,
    configFiles.length ? {configs: configFiles, config: configFiles[configFiles.length - 1]} : undefined,
  ]))
}
github brrd / Abricotine / app / localize.js View on Github external
function getTranslations(lang) {
    var langFiles = [
            paths.join(constants.path.defaultDir, "lang", "en.json"),
            paths.join(constants.path.defaultDir, "lang", lang + ".json"),
            paths.join(constants.path.userData, "lang", lang + ".json")
        ],
        translations = [];
    langFiles.forEach(function(file) {
        try {
            var fileContent = fs.readFileSync(file, 'utf8');
            translations.push(JSON.parse(fileContent));
        } catch (err) {
            console.warn("Error while loading localization data: " + err);
        }
    });
    return deepExtend.apply(this, translations);
}
github edutec / Snap4Arduino-old-huge / modules / gnu / node_modules / serialport / node_modules / node-pre-gyp / node_modules / rc / index.js View on Github external
module.exports = function (name, defaults, argv) {
  if(!name)
    throw new Error('nameless configuration fail')
  if(!argv)
    argv = require('minimist')(process.argv.slice(2))
  defaults = (
      'string' === typeof defaults
    ? cc.json(defaults) : defaults
    ) || {}

  var local = cc.find('.'+name+'rc')

  return deepExtend.apply(null, [
    defaults,
    win ? {} : cc.json(join(etc, name, 'config')),
    win ? {} : cc.json(join(etc, name + 'rc')),
    home ? cc.json(join(home, '.config', name, 'config')) : {},
    home ? cc.json(join(home, '.config', name)) : {},
    home ? cc.json(join(home, '.' + name, 'config')) : {},
    home ? cc.json(join(home, '.' + name + 'rc')) : {},
    cc.json(local || argv.config),
    local ? {config: local} : null,
    cc.env(name + '_'),
    argv
  ])
}
github Frontify / frontify-boilerplate / node_modules / node-inspector / node_modules / rc / index.js View on Github external
module.exports = function (name, defaults, argv) {
  if(!name)
    throw new Error('nameless configuration fail')
  if(!argv)
    argv = require('minimist')(process.argv.slice(2))
  defaults = (
      'string' === typeof defaults
    ? cc.json(defaults) : defaults
    ) || {}

  var local = cc.find('.'+name+'rc')

  return deepExtend.apply(null, [
    defaults,
    win ? {} : cc.json(join(etc, name, 'config')),
    win ? {} : cc.json(join(etc, name + 'rc')),
    home ? cc.json(join(home, '.config', name, 'config')) : {},
    home ? cc.json(join(home, '.config', name)) : {},
    home ? cc.json(join(home, '.' + name, 'config')) : {},
    home ? cc.json(join(home, '.' + name + 'rc')) : {},
    cc.json(local || argv.config),
    local ? {config: local} : null,
    cc.env(name + '_'),
    argv
  ])
}

deep-extend

Recursive object extending

MIT
Latest version published 6 years ago

Package Health Score

67 / 100
Full package analysis