Get an Error instance from error, wrapping a string in a TypeError.
Parameters
error: string|Error
Returns Error
Example
getError('Something went wrong'); // returns new TypeError('Something went wrong') getError(newRangeError('Out of range')); // returns the same RangeError instance
Get an
Errorinstance fromerror, wrapping a string in aTypeError.