How to use the timm.omit function in timm

To help you get started, we’ve selected a few timm 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 guigrpa / oao / src / utils / removeInternalLinks.js View on Github external
Object.keys(prevDeps).forEach(name => {
      // Is package to be removed? Only if it belongs to the internal
      // subpackage list (`pkgNames`) or it matches the custom `linkPattern`
      const fRemove =
        pkgNames.indexOf(name) >= 0 || (regex != null && regex.test(name));
      if (!fRemove) return;
      const version = prevDeps[name];
      if (version == null) return;
      nextDeps = omit(nextDeps, [name]);
      if (!removedPackagesByType[type]) removedPackagesByType[type] = {};
      removedPackagesByType[type][name] = version;
      allRemovedPackages[name] = version;
    });
    nextSpecs = timmSet(nextSpecs, type, nextDeps);
github guigrpa / concise / packages / concise / src / mergeSchemas.js View on Github external
const mergeSchemas = (a: Schema, b: Schema): Schema => {
  let out = a;

  // Non-model specs are merged from `b`
  out = merge(out, omit(b, ['models']));

  // Merge models
  let models = out.models;
  Object.keys(b.models).forEach(modelName => {
    let model = models[modelName];
    const bModel: Object = b.models[modelName];

    // Models from b that didn't exist in a
    if (!model) {
      models = timmSet(models, modelName, bModel);
      return;
    }

    // Preexisting models
    const { description, includes, fields, relations } = bModel;
    model = merge(model, {
github guigrpa / docx-templates / packages / docx-templates / src / reportUtils.js View on Github external
const cloneNodeForLogging = (node: Node): Object =>
  omit(node, ['_parent', '_children']);
github guigrpa / concise / packages / concise-graphql / src / index.js View on Github external
Object.keys(fields).forEach(fieldName => {
    if (fieldName === 'id' && op === 'create') return;
    const field = fields[fieldName];
    if (!field.existsInServer || !field.existsInClient) return;
    const spec = omit(
      field,
      op === 'create' ? ['description'] : ['description', 'isRequired']
    );
    contents = contents.concat(writeField(fieldName, spec, options));
  });
  Object.keys(relations).forEach(fieldName => {
github guigrpa / storyboard / src / gral / serialize.js View on Github external
const doDeserialize = (obj) => {
  if (!isObject(obj)) return obj;
  let out;
  if (Array.isArray(obj)) {
    out = obj.map((el) => doDeserialize(el));
  } else if (obj instanceof Date) {
    out = new Date(obj);
  } else {
    switch (obj[STORYBOARD_TYPE_ATTR]) {
      case 'UNDEFINED':
        out = undefined;
        break;
      case 'ERROR':
        out = omit(obj, STORYBOARD_TYPE_ATTR);
        break;
      case 'BUFFER':
        out = Buffer.from(obj.data);
        break;
      default:
        out = {};
        Object.keys(obj).forEach((key) => {
          out[key] = doDeserialize(obj[key]);
        });
        break;
    }
  }
  return out;
};
github guigrpa / concise / packages / concise-sequelize / src / index.js View on Github external
Model.prototype.toJSON = function toJSON() {
      let json = originalToJSON.call(this);
      json = omit(json, notPublishedFields);
      return json;
    };
github guigrpa / storyboard / packages / storyboard-extension-chrome / src / components / 016-settings.js View on Github external
.then(() => {
        const persistedSettings = omit(settings, ['serverFilter', 'localClientFilter']);
        this.props.updateSettings(persistedSettings);
        if (settings.serverFilter !== this.props.serverFilter) {
          this.props.setServerFilter(settings.serverFilter);
        }
        if (settings.localClientFilter !== this.props.localClientFilter) {
          this.props.setLocalClientFilter(settings.localClientFilter);
        }
        this.props.onClose();
      });
  }