@betterer/errors
Advanced tools
Comparing version 5.3.0 to 6.0.0-alpha.1
@@ -1,2 +0,2 @@ | ||
import { BettererErrorDetails } from './types'; | ||
import type { BettererErrorDetails } from './types.js'; | ||
/** | ||
@@ -15,4 +15,3 @@ * @public A custom Error for use in **Betterer**. It attaches some extra details to a standard | ||
/** | ||
* Used by {@link @betterer/errors#isBettererError | `isBettererError()`} to detect that an | ||
* object is an instance of `BettererError`. | ||
* Used to detect that an object is an instance of `BettererError`. | ||
*/ | ||
@@ -23,13 +22,15 @@ isBettererError: boolean; | ||
/** | ||
* @public Check if an object is a {@link BettererError | `BettererError`}. | ||
* @internal This could change at any point! Please don't use! | ||
* | ||
* Check if an object is a {@link BettererError | `BettererError`}. | ||
* | ||
* @example | ||
* ```typescript | ||
* import { BettererError, isBettererError } from '@betterer/errors'; | ||
* import { BettererError, isBettererErrorΔ } from '@betterer/errors'; | ||
* | ||
* isBettererError(new Error()); // false | ||
* isBettererError(new BettererError()); // true | ||
* isBettererErrorΔ(new Error()); // false | ||
* isBettererErrorΔ(new BettererError()); // true | ||
* ``` | ||
*/ | ||
export declare function isBettererError(err: unknown): err is BettererError; | ||
export declare function isBettererErrorΔ(err: unknown): err is BettererError; | ||
//# sourceMappingURL=error.d.ts.map |
@@ -1,4 +0,1 @@ | ||
"use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
exports.isBettererError = exports.BettererError = void 0; | ||
/** | ||
@@ -11,8 +8,7 @@ * @public A custom Error for use in **Betterer**. It attaches some extra details to a standard | ||
*/ | ||
class BettererError extends Error { | ||
export class BettererError extends Error { | ||
constructor(message, ...details) { | ||
super(message); | ||
/** | ||
* Used by {@link @betterer/errors#isBettererError | `isBettererError()`} to detect that an | ||
* object is an instance of `BettererError`. | ||
* Used to detect that an object is an instance of `BettererError`. | ||
*/ | ||
@@ -25,18 +21,18 @@ this.isBettererError = true; | ||
} | ||
exports.BettererError = BettererError; | ||
/** | ||
* @public Check if an object is a {@link BettererError | `BettererError`}. | ||
* @internal This could change at any point! Please don't use! | ||
* | ||
* Check if an object is a {@link BettererError | `BettererError`}. | ||
* | ||
* @example | ||
* ```typescript | ||
* import { BettererError, isBettererError } from '@betterer/errors'; | ||
* import { BettererError, isBettererErrorΔ } from '@betterer/errors'; | ||
* | ||
* isBettererError(new Error()); // false | ||
* isBettererError(new BettererError()); // true | ||
* isBettererErrorΔ(new Error()); // false | ||
* isBettererErrorΔ(new BettererError()); // true | ||
* ``` | ||
*/ | ||
function isBettererError(err) { | ||
return !!err.isBettererError; | ||
export function isBettererErrorΔ(err) { | ||
return !!err && !!err.isBettererError; | ||
} | ||
exports.isBettererError = isBettererError; | ||
//# sourceMappingURL=error.js.map |
@@ -6,4 +6,5 @@ /** | ||
*/ | ||
export { BettererError, isBettererError } from './error'; | ||
export { BettererErrorDetail, BettererErrorDetails } from './types'; | ||
export type { BettererErrorDetail, BettererErrorDetails } from './types.js'; | ||
export { BettererError, isBettererErrorΔ } from './error.js'; | ||
export { invariantΔ } from './invariant.js'; | ||
//# sourceMappingURL=index.d.ts.map |
@@ -1,2 +0,1 @@ | ||
"use strict"; | ||
/** | ||
@@ -7,7 +6,4 @@ * Error type used within {@link https://github.com/phenomnomnominal/betterer | **Betterer**}. | ||
*/ | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
exports.isBettererError = exports.BettererError = void 0; | ||
var error_1 = require("./error"); | ||
Object.defineProperty(exports, "BettererError", { enumerable: true, get: function () { return error_1.BettererError; } }); | ||
Object.defineProperty(exports, "isBettererError", { enumerable: true, get: function () { return error_1.isBettererError; } }); | ||
export { BettererError, isBettererErrorΔ } from './error.js'; | ||
export { invariantΔ } from './invariant.js'; | ||
//# sourceMappingURL=index.js.map |
@@ -8,5 +8,5 @@ // This file is read by tools that parse documentation comments conforming to the TSDoc standard. | ||
"packageName": "@microsoft/api-extractor", | ||
"packageVersion": "7.18.20" | ||
"packageVersion": "7.47.7" | ||
} | ||
] | ||
} |
@@ -1,2 +0,2 @@ | ||
import { BettererError } from './error'; | ||
import type { BettererError } from './error.js'; | ||
/** | ||
@@ -7,7 +7,7 @@ * @public An additional piece of information attached to a {@link BettererError | `BettererError`}. | ||
*/ | ||
export declare type BettererErrorDetail = string | Error | BettererError; | ||
export type BettererErrorDetail = string | Error | BettererError; | ||
/** | ||
* @public A list of {@link BettererErrorDetail | `BettererErrorDetail`s }. | ||
*/ | ||
export declare type BettererErrorDetails = ReadonlyArray<BettererErrorDetail>; | ||
export type BettererErrorDetails = ReadonlyArray<BettererErrorDetail>; | ||
//# sourceMappingURL=types.d.ts.map |
@@ -1,3 +0,2 @@ | ||
"use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
export {}; | ||
//# sourceMappingURL=types.js.map |
{ | ||
"name": "@betterer/errors", | ||
"description": "error handler for @betterer/betterer", | ||
"version": "5.3.0", | ||
"version": "6.0.0-alpha.1", | ||
"license": "MIT", | ||
@@ -11,2 +11,3 @@ "publishConfig": { | ||
"types": "dist/index.d.ts", | ||
"type": "module", | ||
"files": [ | ||
@@ -29,5 +30,5 @@ "dist" | ||
"engines": { | ||
"node": ">=12" | ||
"node": ">=16" | ||
}, | ||
"gitHead": "6e4a7704c311f5aa5658e3afc1a20c6a7e5ea8f0" | ||
"gitHead": "821992635c8b6a4891169dad3334203f866e5521" | ||
} |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
No v1
QualityPackage is not semver >=1. This means it is not stable and does not support ^ ranges.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
20
153
Yes
10375
1