How to use deep-extend - 10 common examples

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 ueboot / ueboot / ueboot-view / src / components / form-grid / UFormGrid.vue View on Github external
this.formatFormField(data);
                        this.$set(this.formGrid.form, 'data', data)
                        if (type === 'view') {
                            this.modal.viewModal = true;
                        } else {
                            this.modal.editModal = true;
                        }
                        this.$forceUpdate();
                    }).catch(response => {
                        this.noticeError('获取数据失败', response.body);
                        this.$forceUpdate();
                        return false;
                    });
                } else {
                    Log.d('get data :%o', row);
                    let rowData = deepExtend({}, row);
                    this.formatFormField(rowData);
                    let keys = Object.keys(rowData)
                    keys.forEach((k) => {
                        this.$set(this.formGrid.form.data, k, rowData[k])
                    })
                    this.$nextTick(() => {
                        if (type === 'view') {
                            this.modal.viewModal = true;
                        } else {
                            this.modal.editModal = true;
                        }
                    })
                }
            },
            // 操作查看按钮
github swagger-api / swagger-ui / src / core / system.js View on Github external
// This should only happen if dest is the first plugin, since invocations after that will ensure its an array
        if(!Array.isArray(action)) {
          action = [action]
          wrapActions[actionName] = action // Put the value inside an array
        }

        if(src && src.statePlugins && src.statePlugins[namespace] && src.statePlugins[namespace].wrapActions && src.statePlugins[namespace].wrapActions[actionName]) {
          src.statePlugins[namespace].wrapActions[actionName] = wrapActions[actionName].concat(src.statePlugins[namespace].wrapActions[actionName])
        }

      }
    }
  }

  return deepExtend(dest, src)
}
github srtucker22 / glipchat / server / publications / user.publications.js View on Github external
room: Match.Maybe(String), // the current room
    contacts: Match.Maybe([Match.Any]), // include contacts
  });

  const userProjection = {
    fields: { profile: 1, history: 1, status: 1, services: 1 },
  };

  if (Roles.userIsInRole(this.userId, MANAGER_ROLES)) {
    return Meteor.users.find({}, userProjection);
  }
  const res = [];
  res.push(Meteor.users.find(this.userId, userProjection));

  if (opts.room) {
    res.push(Roles.getUsersInRole(opts.room, Roles.GLOBAL_GROUP, deepExtend({
      fields: {
        'roles.__global_roles__.$': 1,
      },
    }, userProjection)));
  }

  if (opts.contacts) {
    res.push(Meteor.users.find({
      'services.google.email': { $in: _.pluck(opts.contacts, 'email') },
    }, {
      fields: {
        profile: 1,
        status: 1,
      },
    }));
  }
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 epam / NGB / client / client / app / shared / dispatcher / dispatcher.js View on Github external
_emitEventGeneral(event, hub = false) {
        const state = event.state;
        this.eventsState = deepExtend((this.eventsState || {}), {[event.name]: state});

        if (!this.listenerCount()) {

            this.emit('log', event);
            this.emit(event.name, state);

            hub && this.emit('eventHub', event);
        }
    }

deep-extend

Recursive object extending

MIT
Latest version published 6 years ago

Package Health Score

67 / 100
Full package analysis