How to use merge - 10 common examples

To help you get started, we’ve selected a few merge 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 datosgobar / consulta-publica / lib / topics-filter / topics-filter.js View on Github external
set (key, value) {
    if (2 === arguments.length) {
      // Create param object and call recursively
      var obj = {};
      obj[key] = value;
      return this.set(obj);
    }

    // key is an object
    merge(this.$_filters, key);

    // notify change of filters
    this.ready(onready.bind(this));

    function onready() {
      this.emit('change', this.get());
    }

    // reload items with updated filters
    this.reload();

    // save current state
    return this.save();
  }
github sasstools / sass-lint / lib / config.js View on Github external
// If it does then retrieve the value of it here or return false
  configMerge = configMergeExists ? config.options['merge-default-rules'] : false;

  // check to see if inline options contains an options property and whether property has a property called merge-default-rules
  optionsMergeExists = (options.options && typeof options.options['merge-default-rules'] !== 'undefined');

  // If it does then retrieve the value of it here or return false
  optionsMerge = optionsMergeExists ? options.options['merge-default-rules'] : false;


  // order of preference is inline options > user config > default config
  // merge-default-rules defaults to true so each step above should merge with the previous. If at any step merge-default-rules is set to
  // false it should skip that steps merge.
  defaults = confHelpers.loadDefaults();
  finalConfig = merge.recursive(defaults, config, options);

  // if merge-default-rules is set to false in user config file then we essentially skip the merging with default rules by overwriting our
  // final rules with the content of our user config otherwise we don't take action here as the default merging has already happened
  if (configMergeExists && !configMerge) {
    finalConfig.rules = config.rules;
  }

  // if merge-default-rules is set to false in inline options we essentially skip the merging with our current rules by overwriting our
  // final rules with the content of our user config otherwise we check to see if merge-default-rules is true OR that we have any inline
  // rules, if we do then we want to merge these into our final ruleset.
  if (optionsMergeExists && !optionsMerge) {
    finalConfig.rules = options.rules;
  }
  else if ((optionsMergeExists && optionsMerge) || options.rules && Object.keys(options.rules).length > 0) {
    finalConfig.rules = merge.recursive(finalConfig.rules, options.rules);
  }
github liferay / liferay-js-toolkit / packages / liferay-npm-bundler / src / config / index.js View on Github external
if (config.preset === undefined) {
		presetFile = require.resolve('liferay-npm-bundler-preset-standard');
	} else if (config.preset === '' || config.preset === false) {
		// don't load preset
	} else {
		presetFile = resolveModule.sync(config.preset, {
			basedir: '.',
		});
	}

	if (presetFile) {
		const originalConfig = Object.assign({}, config);
		Object.assign(
			config,
			merge.recursive(readJsonSync(presetFile), originalConfig)
		);
		config.pluginsBaseDir = getPackageDir(presetFile);
	}

	// Normalize
	config['/'] = config['/'] || {};
	config['config'] = config['config'] || {};
	config.packages = config.packages || {};
}
github scottcorgan / tessed / index.js View on Github external
return tapeFn(testName, function (t) {

      var end = t.end.bind(t)

      // Call all beforeEach fns and set return as context
      // to pass to test methods

      var beforeEachReturns = beforeEach.map(function (be) {

        return be()
      })

      t.context = merge.apply(null, beforeEachReturns)
      t.end = function () {

        afterEach.forEach(function (ae) {

          ae({
            context: t.context
          })
        })
        end()
      }

      //
      var ret = fn({
        equal: t.equal,
        deepEqual: t.deepEqual,
        pass: t.pass,
github reddit / node-platform / merge.js View on Github external
(function webpackUniversalModuleDefinition(root, factory) {
	if(typeof exports === 'object' && typeof module === 'object')
		module.exports = factory(require("lodash/lang"));
	else if(typeof define === 'function' && define.amd)
		define(["lodash/lang"], factory);
	else if(typeof exports === 'object')
		exports["merge.js"] = factory(require("lodash/lang"));
	else
		root["merge.js"] = factory(root["lodash/lang"]);
})(this, function(__WEBPACK_EXTERNAL_MODULE_12__) {
return /******/ (function(modules) { // webpackBootstrap
github reddit / node-platform / merge.js View on Github external
(function webpackUniversalModuleDefinition(root, factory) {
	if(typeof exports === 'object' && typeof module === 'object')
		module.exports = factory(require("lodash/lang"));
	else if(typeof define === 'function' && define.amd)
		define(["lodash/lang"], factory);
	else if(typeof exports === 'object')
		exports["merge.js"] = factory(require("lodash/lang"));
	else
		root["merge.js"] = factory(root["lodash/lang"]);
})(this, function(__WEBPACK_EXTERNAL_MODULE_12__) {
return /******/ (function(modules) { // webpackBootstrap
github matfish2 / vue-formular / lib / components / fields / textarea.js View on Github external
module.exports = function() {
  return merge.recursive(Field(), {
  props: {
    placeholder: {
      type:String,
      required:false,
      default:''
    },
    disabled: {
      type: Boolean
    },
    tinymce:{
      default: false
    },
    debounce:{
      type:Number,
      default:300
    },
github matfish2 / vue-form-2 / lib / index.js View on Github external
data: function() {
      return {
        globalOptions: globalOptions ? globalOptions : {},
        templates: merge.recursive(fields, customFields),
        isForm: true,
        vffields: [],
        additionalValues: [],
        vferrors: [],
        relatedFields: {},
        triggeredFields: {},
        sending: false
      };
    },
    computed: {
github matfish2 / vue-form-2 / lib / components / fields / buttons-list.js View on Github external
module.exports = function() {
  return merge.recursive(Field(), {
    data: function() {
      return {
        fieldType: "buttons",
        allSelected: false,
        filteringField: null,
        allSelected: false,
        clearText: "Clear",
        toggleTexts: {
          select: "Select All",
          unselect: "Unselect All"
        }
      };
    },
    props: {
      items: {
        type: Array,
github kaspernj / api_maker / npm-api-maker / src / collection.js View on Github external
_merge(object1, object2) {
    return merge.recursive(true, object1, object2)
  }

merge

(recursive)? merging of (cloned)? objects.

MIT
Latest version published 3 years ago

Package Health Score

67 / 100
Full package analysis