Clean up other extensions
2 files changed, 8 insertions, 5 deletions
diff --git a/src/util/util/extensions/Global.ts b/src/util/util/extensions/Global.ts
index a6886f66..0dc39b42 100644
--- a/src/util/util/extensions/Global.ts
+++ b/src/util/util/extensions/Global.ts
@@ -2,9 +2,13 @@ declare global {
function sleep(ms: number): Promise<void>;
}
+export function globalSleep(ms: number): Promise<void> {
+ return new Promise((resolve) => setTimeout(resolve, ms));
+}
+
if (!globalThis.sleep) {
globalThis.sleep = function (ms: number): Promise<void> {
- return new Promise((resolve) => setTimeout(resolve, ms));
+ return globalSleep(ms);
};
}
diff --git a/src/util/util/extensions/Math.ts b/src/util/util/extensions/Math.ts
index 76587bc5..a5bd80c3 100644
--- a/src/util/util/extensions/Math.ts
+++ b/src/util/util/extensions/Math.ts
@@ -22,11 +22,10 @@ declare global {
}
}
-export function clamp(value: number, min: number, max: number): number {
+export function mathClamp(value: number, min: number, max: number): number {
return Math.min(Math.max(value, min), max);
}
// register extensions
-if (!Math.clamp) {
- Math.clamp = clamp;
-}
\ No newline at end of file
+if (!Math.clamp)
+ Math.clamp = mathClamp;
\ No newline at end of file
|