A quick shortcut to throw errors for function params
function function throwError(propName: string): void
throwError(propName: string
propName: string) {
throw new var Error: ErrorConstructor
new (message?: string | undefined, options?: ErrorOptions | undefined) => Error (+1 overload)
Error(`'${propName: string
propName}' is required`)
}
function function doSomething(someArg?: void): void
doSomething(someArg: void
someArg = function throwError(propName: string): void
throwError("someArg")) {
return someArg: void
someArg;
}
function doSomething(someArg?: void): void
doSomething();
// Uncaught Error: someArg is required