Skip to content

Conversation

@k0stik
Copy link
Member

@k0stik k0stik commented Jun 9, 2023

No description provided.

constructor(config) {
this._json = deepClone(config || {});
constructor(config = {}) {
this._json = this.constructor._isDeepCloneRequired ? deepClone(config) : clone(config);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'd add explicitly a static var: static _isDeepCloneRequired = false

toJSON(exclude = []) {
const config = deepClone(lodash.omit(this._json, exclude));
return this.clean(config);
toJSON(exclude = [], unsafeClone = false) {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

isDeepCloneOmitted

@timurbazhirov timurbazhirov merged commit cf249dc into main Jun 19, 2023
@timurbazhirov timurbazhirov deleted the update/SOF-6584 branch June 19, 2023 17:08
k0stik pushed a commit that referenced this pull request Jul 31, 2023
SOF-6584: js spread operator instead deepClone fro in_memory entity
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants