Move key stuff to util, add pow util
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user