Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

SOF-6584: js spread operator instead deepClone fro in_memory entity #49

Merged
merged 7 commits into from
Jun 19, 2023

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.

2 participants