@perfective/error
Advanced tools
Comparing version 0.1.0 to 0.1.1
{ | ||
"name": "@perfective/error", | ||
"version": "0.1.0", | ||
"version": "0.1.1", | ||
"description": "Functions for the Error and other types to handle exceptions", | ||
@@ -5,0 +5,0 @@ "author": "Andrey Mikheychik <a.mikheychik@gmail.com>", |
# Error | ||
The `@perfective/error` package provides functions for the `Error` type | ||
and other types to handle exceptions. | ||
The `@perfective/error` package provides functions for the | ||
[`Error`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Error) class | ||
and other error types. | ||
* `throws<E extends Error>(error?: E | string): never` | ||
— throws a provided error. | ||
* `panic<E extends Error>(error?: E | string): () => never` | ||
— creates a function that throws a provided error. | ||
* [`Error`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Error): | ||
* `error(message?: string): Error` | ||
— instantiates a new `Error`. | ||
* `isError<T>(value: Error | T): value is Error` | ||
— returns `true` when the value is an instance of `Error`. | ||
* `isNotError<T>(value: Error | T): value is T` | ||
— returns `true` when the value is not an instance of `Error`. | ||
* [`EvalError`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/EvalError): | ||
* `evalError(message?: string): EvalError` | ||
— instantiates a new `EvalError`. | ||
* `isEvalError<T>(value: EvalError | T): value is EvalError` | ||
— returns `true` when the value is an instance of `EvalError`. | ||
* `isNotEvalError<T>(value: EvalError | T): value is T` | ||
— returns `true` when the value is not an instance of `EvalError`. | ||
* [`RangeError`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/RangeError): | ||
* `rangeError(message?: string): RangeError` | ||
— instantiates a new `RangeError`. | ||
* `isRangeError<T>(value: RangeError | T): value is RangeError` | ||
— returns `true` when the value is an instance of `RangeError`. | ||
* `isNotRangeError<T>(value: RangeError | T): value is T` | ||
— returns `true` when the value is not an instance of `RangeError`. | ||
* [`ReferenceError`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/ReferenceError): | ||
* `referenceError(message?: string): ReferenceError` | ||
— instantiates a new `ReferenceError`. | ||
* `isReferenceError<T>(value: ReferenceError | T): value is ReferenceError` | ||
— returns `true` when the value is an instance of `ReferenceError`. | ||
* `isNotReferenceError<T>(value: ReferenceError | T): value is T` | ||
— returns `true` when the value is not an instance of `ReferenceError`. | ||
* [`SyntaxError`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/SyntaxError): | ||
* `syntaxError(message?: string): SyntaxError` | ||
— instantiates a new `SyntaxError`. | ||
* `isSyntaxError<T>(value: SyntaxError | T): value is SyntaxError` | ||
— returns `true` when the value is an instance of `SyntaxError`. | ||
* `isNotSyntaxError<T>(value: SyntaxError | T): value is T` | ||
— returns `true` when the value is not an instance of `SyntaxError`. | ||
* [`TypeError`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypeError): | ||
* `typeError(message?: string): TypeError` | ||
— instantiates a new `TypeError`. | ||
* `isTypeError<T>(value: TypeError | T): value is TypeError` | ||
— returns `true` when the value is an instance of `TypeError`. | ||
* `isNotTypeError<T>(value: TypeError | T): value is T` | ||
— returns `true` when the value is not an instance of `TypeError`. | ||
Read the [full documentation](https://github.com/perfective/js/blob/master/packages/error/README.adoc) | ||
in the repository. |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
44046
56