Open History to see the last commit
1export function shouldThrowError<T extends (...args: Array<any>) => boolean>(
2 throwError: boolean | T | undefined,
3 params: Parameters<T>,
4): boolean {
5 // Allow throwError function to override throwing behavior on a per-error basis
6 if (typeof throwError === 'function') {
7 return throwError(...params)
8 }
9β
10 return !!throwError
11}
12β
13export function noop() {}