|
@@ -276,9 +276,6 @@ function exeExcelConfig() {
|
|
|
});
|
|
|
|
|
|
let pro = '';
|
|
|
- if (hang == 4) {
|
|
|
- pro += 'import { CTX } from "../src/util/master";\n';
|
|
|
- }
|
|
|
|
|
|
pro += `export default class ConfProxy<T> {
|
|
|
static getKey(args: string[]): string {
|
|
@@ -306,6 +303,19 @@ function exeExcelConfig() {
|
|
|
});
|
|
|
}
|
|
|
|
|
|
+ deepFreeze<T>(obj: T): T {
|
|
|
+ Object.freeze(obj);
|
|
|
+ Object.getOwnPropertyNames(obj).forEach(prop => {
|
|
|
+ const value = (obj as Record<string, any>)[prop];
|
|
|
+ if (value !== null
|
|
|
+ && (typeof value === "object" || typeof value === "function")
|
|
|
+ && !Object.isFrozen(value)) {
|
|
|
+ this.deepFreeze(value);
|
|
|
+ }
|
|
|
+ });
|
|
|
+ return obj as T;
|
|
|
+ }
|
|
|
+
|
|
|
getItem(...args: string[]): T | null {
|
|
|
return this.pool[ConfProxy.getKey(args)]
|
|
|
}`;
|