Skip to content

Commit

Permalink
not using deep clone anymore to keep enum equality
Browse files Browse the repository at this point in the history
  • Loading branch information
TheSlimvReal committed Mar 23, 2023
1 parent c6ed3be commit 39f8593
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions src/app/core/entity/model/entity.ts
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,6 @@ import { EntitySchema } from "../schema/entity-schema";
import { DatabaseField } from "../database-field.decorator";
import { getWarningLevelColor, WarningLevel } from "./warning-level";
import { IconName } from "@fortawesome/fontawesome-svg-core";
import { cloneDeep } from "lodash-es";

/**
* This represents a static class of type <T>.
Expand Down Expand Up @@ -302,7 +301,7 @@ export class Entity {
*/
public copy(generateNewId: boolean = false): this {
const other = new (this.getConstructor())(this._id);
Object.assign(other, cloneDeep(this));
Object.assign(other, this);

if (generateNewId) {
delete other._rev;
Expand Down

0 comments on commit 39f8593

Please sign in to comment.