@perfective/error
Advanced tools
Comparing version 0.2.0-alpha.3 to 0.2.0-alpha.4
{ | ||
"name": "@perfective/error", | ||
"version": "0.2.0-alpha.3", | ||
"version": "0.2.0-alpha.4", | ||
"description": "Functions for the Error and other types to handle exceptions", | ||
@@ -21,4 +21,9 @@ "keywords": [ | ||
"license": "MIT", | ||
"main": "dist/index.js", | ||
"types": "dist/index.d.ts", | ||
"main": "dist/cjs/index.js", | ||
"module": "dist/mjs/index.mjs", | ||
"types": "dist/mjs/index.d.ts", | ||
"exports": { | ||
"import": "dist/mjs/index.mjs", | ||
"require": "dist/cjs/index.cjs" | ||
}, | ||
"files": [ | ||
@@ -29,4 +34,6 @@ "dist" | ||
"scripts": { | ||
"build": "tsc --project ./tsconfig.build.json", | ||
"build": "npm run build:cjs && npm run build:mjs", | ||
"build:clean": "npm run clean && npm run build", | ||
"build:cjs": "tsc --project tsconfig.build.cjs.json", | ||
"build:mjs": "tsc --project ./tsconfig.build.mjs.json && mv dist/mjs/index.js dist/mjs/index.mjs", | ||
"clean": "rm -rf dist && rm -f *.tsbuildinfo", | ||
@@ -33,0 +40,0 @@ "lint": "npm run lint:eslint; npm run lint:tslint", |
@@ -15,6 +15,6 @@ # Error | ||
— outputs the stack of all error messages. | ||
* `exception(message: string, context: ExceptionContext = {}): Exception` | ||
— creates a new `Exception` without a previous error. | ||
* `causedBy(previous: Error, message: string, context: ExceptionContext = {}): Exception` | ||
— creates a new `Exception` with a previous error. | ||
* `exception(message: string, tokens: ExceptionTokens = {}, context: ExceptionContext = {}): Exception` | ||
— creates an `Exception` without a previous error. | ||
* `causedBy(previous: Error, message: string, tokens: ExceptionTokens = {}, context: ExceptionContext = {}): Exception` | ||
— creates an `Exception` with a previous error. | ||
* `isException<T>(value: Exception | T): value is Exception` | ||
@@ -28,2 +28,7 @@ — returns `true` when value is an `Exception`. | ||
— returns the first error in the chain. | ||
* `ExceptionMessage`: | ||
* `exceptionMessage(template: string, tokens?: ExceptionTokens): ExceptionMessage` | ||
— creates an `ExceptionMessage` with an empty tokens object if the argument not provided. | ||
* `exceptionMessageOutput(message: ExceptionMessage): string` | ||
— creates a string to output an `ExceptionMessage`. | ||
* Throwing errors: | ||
@@ -30,0 +35,0 @@ * `throws<E extends Error>(error: E): never` |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Major refactor
Supply chain riskPackage has recently undergone a major refactor. It may be unstable or indicate significant internal changes. Use caution when updating to versions that include significant changes.
Found 1 instance in 1 package
370085
111
732
88
1