How to use the timm.clone 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 / concise / packages / concise / src / preprocessSchema.js View on Github external
}
      const idField = relatedModel.fields.id;
      if (!idField) {
        throw new Error(
          `ID_FIELD_NOT_FOUND ${modelName}/${relationName}/${relatedModelName}`
        );
      }
      relation.type = idField.type;

      // Create inverse relation, if needed
      const { inverse } = relation;
      if (inverse !== false) {
        let inverseRelation =
          inverse == null || inverse === true
            ? {} // inverse shorthand
            : omit(clone(inverse), ['name']);
        inverseRelation = addDefaults(inverseRelation, {
          model: modelName,
          isPlural: true,
          isInverse: true,
          inverseName: relationName,
        });
        const idField2 = models[modelName].fields.id;
        inverseRelation.type = idField2 ? idField2.type : undefined;
        const { isPlural: isInversePlural } = inverseRelation;
        const inverseName =
          (inverse && inverse.name) ||
          (isInversePlural ? pluralize(modelName) : modelName);
        const inverseFkName = getFkName(
          inverseName,
          isInversePlural != null ? isInversePlural : true
        );
github guigrpa / jest-html / src / server / extractor.js View on Github external
const configure = (newConfig: $Shape) => {
  if (!_config) {
    _config = clone(newConfig);
    return;
  }
  _config = (merge(_config, newConfig): any);
};