@webdeveric/utils
    Preparing search index...

    Function getError

    • Get an Error instance from error, wrapping a string in a TypeError.

      Parameters

      • error: string | Error

      Returns Error

      getError('Something went wrong'); // returns new TypeError('Something went wrong')
      getError(new RangeError('Out of range')); // returns the same RangeError instance