Files
railwaysystem/RuoYi-Vue/ruoyi-ui/node_modules1/hyperformula/es/Destroy.js
T
2026-09-10 15:40:10 +08:00

18 lines
469 B
JavaScript

/**
* @license
* Copyright (c) 2024 Handsoncode. All rights reserved.
*/
export function objectDestroy(object) {
for (const [key, value] of Object.entries(object)) {
if (value instanceof Function) {
object[key] = postMortem(value);
} else {
delete object[key];
}
}
}
function postMortem(method) {
return () => {
throw new Error(`The "${method}" method cannot be called because this HyperFormula instance has been destroyed`);
};
}