How to use the lodash-es/cloneDeep function in lodash-es

To help you get started, we’ve selected a few lodash-es 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 Texera / texera / core / new-gui / src / app / workspace / service / autocomplete / util / autocomplete.utils.ts View on Github external
public static addInputSchemaToOperatorSchema(operatorSchema: OperatorSchema, inputSchema: ReadonlyArray): OperatorSchema {
    // If the inputSchema is empty, just return the original operator metadata.
    if (!inputSchema || inputSchema.length === 0) {
      return operatorSchema;
    }

    const jsonSchemaToModify = cloneDeep(operatorSchema.jsonSchema);
    const operatorProperties = jsonSchemaToModify.properties;
    if (!operatorProperties) {
      throw new Error(`Operator ${operatorSchema.operatorType} does not have properties in its schema`);
    }

    // There are some operators which only take one of the attributes as input (eg: Analytics group) and some
    // which take more than one (eg: Search group). Therefore, the jsonSchema for these operators are different.
    // TODO: Standardize this i.e. All operators should accept input schema in a common key of json.
    // TODO: Join operators have two inputs - inner and outer. Autocomplete API currently returns all attributes
    //       in a single array. So, we can't differentiate between inner and outer. Therefore, autocomplete isn't applicable
    //       to Join yet.
    const items_key_in_schemajson = 'items';
    const attribute_list_key_in_schemajson = 'attributes';
    const single_attribute_in_schemajson = 'attribute';

    if (single_attribute_in_schemajson in operatorProperties) {
github hamzahamidi / Angular6-json-schema-form / projects / angular6-json-schema-form / src / lib / shared / layout.functions.ts View on Github external
newNode.options.tupleItems ? 'tuple' : 'list';
        }

        if (isArray(newNode.items)) {
          const arrayListItems =
            newNode.items.filter(item => item.type !== '$ref').length -
            newNode.options.tupleItems;
          if (arrayListItems > newNode.options.listItems) {
            newNode.options.listItems = arrayListItems;
            nodeDataMap.set('listItems', arrayListItems);
          }
        }

        if (!hasOwn(jsf.layoutRefLibrary, itemRefPointer)) {
          jsf.layoutRefLibrary[itemRefPointer] =
            cloneDeep(newNode.items[newNode.items.length - 1]);
          if (recursive) {
            jsf.layoutRefLibrary[itemRefPointer].recursiveReference = true;
          }
          forEach(jsf.layoutRefLibrary[itemRefPointer], (item, key) => {
            if (hasOwn(item, '_id')) { item._id = null; }
            if (recursive) {
              if (hasOwn(item, 'dataPointer')) {
                item.dataPointer = item.dataPointer.slice(itemRefPointer.length);
              }
            }
          }, 'top-down');
        }

        // Add any additional default items
        if (!newNode.recursiveReference || newNode.options.required) {
          const arrayLength = Math.min(Math.max(
github ovh / cds / ui / src / app / views / workflow / run / node / pipeline / step / step.log.component.ts View on Github external
parseLogs() {
        this.splittedLogs = this.getLogsSplitted()
            .map((log, i) => {
                if (this.ansiViewSelected) {
                    return { lineNumber: i + 1, value: this.ansi_up.ansi_to_html(log) };
                }
                return { lineNumber: i + 1, value: log };
            });
        this.splittedLogsToDisplay = cloneDeep(this.splittedLogs);

        if (!this.allLogsView && this.splittedLogs.length > 1000 && !this._route.snapshot.fragment) {
            this.limitFrom = 30;
            this.limitTo = this.splittedLogs.length - 40;
            this.splittedLogsToDisplay.splice(this.limitFrom, this.limitTo - this.limitFrom);
        } else {
            this.splittedLogsToDisplay = this.splittedLogs;
        }
    }
github DivanteLtd / vue-storefront / core / helpers / initialStateFactory.ts View on Github external
  const createInitialState = (currentState) => ({ ...cloneDeep(currentState), ...defaultFields })
github ovh / cds / ui / src / app / views / pipeline / show / admin / pipeline.admin.component.ts View on Github external
set pipeline(data: Pipeline) {
        this.oldName = data.name;
        this.editablePipeline = cloneDeep(data);
    }
github ovh / cds / ui / src / app / views / application / add / application.add.component.ts View on Github external
.subscribe(app => {
                this.selectedApplication = app;
                this.variables = cloneDeep(app.variables);
                if (this.variables) {
                    this.variables.forEach(v => {
                        if (v.type === 'password') {
                            v.value = '';
                        }
                    });
                }
                this._cd.markForCheck();
            });
    }
github ovh / cds / ui / src / app / views / workflow / run / node / pipeline / node.pipeline.component.ts View on Github external
selectedJobManual(j: Job) {
        let queryParams = cloneDeep(this._route.snapshot.queryParams);
        queryParams['stageId'] = null;
        queryParams['actionId'] = null;
        queryParams['stepOrder'] = null;
        queryParams['line'] = null;
        this.manual = true;

        this._router.navigate(['.'], { relativeTo: this._route, queryParams, fragment: null });
        this.selectedJob(j);
    }
github hamzahamidi / Angular6-json-schema-form / projects / angular6-json-schema-form / src / lib / json-schema-form.component.ts View on Github external
private initializeData() {
    if (hasValue(this.data)) {
      this.jsf.formValues = cloneDeep(this.data);
      this.formValuesInput = 'data';
    } else if (hasValue(this.model)) {
      this.jsf.AngularSchemaFormCompatibility = true;
      this.jsf.formValues = cloneDeep(this.model);
      this.formValuesInput = 'model';
    } else if (hasValue(this.ngModel)) {
      this.jsf.AngularSchemaFormCompatibility = true;
      this.jsf.formValues = cloneDeep(this.ngModel);
      this.formValuesInput = 'ngModel';
    } else if (isObject(this.form) && hasValue(this.form.value)) {
      this.jsf.JsonFormCompatibility = true;
      this.jsf.formValues = cloneDeep(this.form.value);
      this.formValuesInput = 'form.value';
    } else if (isObject(this.form) && hasValue(this.form.data)) {
      this.jsf.formValues = cloneDeep(this.form.data);
      this.formValuesInput = 'form.data';
github SayakMukhopadhyay / elitebgs / src / app / admin / users / admin-users-view.component.ts View on Github external
reset: () => {
                this.userUnderEdit = cloneDeep(this.userData);
            },
            delete: () => {