initial commit. phase 1 complete

This commit is contained in:
2026-05-05 20:45:19 +02:00
parent d9c68313a0
commit 89e058ffac
20631 changed files with 3224610 additions and 43 deletions
+30
View File
@@ -0,0 +1,30 @@
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
Object.defineProperty(exports, "deepFreeze", {
enumerable: true,
get: function() {
return deepFreeze;
}
});
function deepFreeze(obj) {
// If the object is already frozen, there's no need to freeze it again.
if (Object.isFrozen(obj)) return obj;
// An array is an object, but we also want to freeze each element in the array
// as well.
if (Array.isArray(obj)) {
for (const item of obj){
if (!item || typeof item !== "object") continue;
deepFreeze(item);
}
return Object.freeze(obj);
}
for (const value of Object.values(obj)){
if (!value || typeof value !== "object") continue;
deepFreeze(value);
}
return Object.freeze(obj);
}
//# sourceMappingURL=deep-freeze.js.map