Created
December 23, 2021 09:06
-
-
Save hitautodestruct/ed2be9a9f4214fef1fb024c7ba650ac3 to your computer and use it in GitHub Desktop.
Revisions
-
hitautodestruct revised this gist
Dec 23, 2021 . 1 changed file with 0 additions and 1 deletion.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -4,7 +4,6 @@ function deepFreeze (object) { var propNames = Object.getOwnPropertyNames(object) // Freeze properties before freezing self for (let name of propNames) { let value = object[name] -
hitautodestruct renamed this gist
Dec 23, 2021 . 1 changed file with 0 additions and 0 deletions.There are no files selected for viewing
File renamed without changes. -
hitautodestruct created this gist
Dec 23, 2021 .There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,18 @@ function deepFreeze (object) { if (object) { // Retrieve the property names defined on object var propNames = Object.getOwnPropertyNames(object) // Freeze properties before freezing self for (let name of propNames) { let value = object[name] object[name] = value && typeof value === 'object' ? DataMigration.deepFreeze(value) : value } object = Object.freeze(object) } return object }