Move key stuff to util, add pow util

This commit is contained in:
Jon Staab
2025-12-02 13:15:24 -08:00
parent 6da8e6c654
commit 351b60631e
18 changed files with 253 additions and 91 deletions
+7
View File
@@ -1032,6 +1032,13 @@ export const tryCatch = <T>(f: () => T, onError?: (e: Error) => void): T | undef
return undefined
}
/**
* Throws an error with the given message
*/
export const thrower = (message: string) => () => {
throw new Error(message)
}
/**
* Creates function that only executes once
* @param f - Function to wrap