Comparing version 3.4.0 to 3.5.0-next.1591780522.70bd5833390698272d3900a9c1e379b7e3b5481a
@@ -14,3 +14,3 @@ declare type PotentialError = Errlop | Error | ErrorCodeHolder | string | ||
*/ | ||
parent?: Errlop | Error | ||
parent?: Errlop | Error | null | ||
/** An array of all the ancestors. From parent, to grand parent, and so on. */ | ||
@@ -37,3 +37,3 @@ ancestors: Array<Errlop | Error> | ||
*/ | ||
static create(input: PotentialError, parent?: Errlop | Error): Errlop | ||
static create(input: PotentialError, parent?: Errlop | Error | null): Errlop | ||
/** | ||
@@ -43,3 +43,3 @@ * Create an instance of an error, using a message, as well as an optional parent. | ||
*/ | ||
constructor(input: PotentialError, parent?: Errlop | Error) | ||
constructor(input: PotentialError, parent?: Errlop | Error | null) | ||
/** Check whether or not the value is an Errlop instance */ | ||
@@ -46,0 +46,0 @@ static isErrlop(value: any): boolean |
@@ -26,3 +26,3 @@ /** Only accept codes that are numbers, otherwise discard them */ | ||
*/ | ||
constructor(input, parent) { | ||
constructor(input, parent = null) { | ||
if (!input) throw new Error('Attempted to create an Errlop without a input') | ||
@@ -67,3 +67,3 @@ // Instantiate with the above | ||
*/ | ||
static create(input, parent) { | ||
static create(input, parent = null) { | ||
return new this(input, parent) | ||
@@ -70,0 +70,0 @@ } |
@@ -39,3 +39,3 @@ type PotentialError = Errlop | Error | ErrorCodeHolder | string | ||
*/ | ||
public parent?: Errlop | Error | ||
public parent?: Errlop | Error | null | ||
@@ -67,3 +67,6 @@ /** An array of all the ancestors. From parent, to grand parent, and so on. */ | ||
*/ | ||
static create(input: PotentialError, parent?: Errlop | Error): Errlop { | ||
static create( | ||
input: PotentialError, | ||
parent: Errlop | Error | null = null | ||
): Errlop { | ||
return new this(input, parent) | ||
@@ -76,3 +79,3 @@ } | ||
*/ | ||
constructor(input: PotentialError, parent?: Errlop | Error) { | ||
constructor(input: PotentialError, parent: Errlop | Error | null = null) { | ||
if (!input) throw new Error('Attempted to create an Errlop without a input') | ||
@@ -79,0 +82,0 @@ |
@@ -54,2 +54,5 @@ 'use strict' | ||
function Errlop(input, parent) { | ||
if (parent === void 0) { | ||
parent = null | ||
} | ||
var _this = this | ||
@@ -97,2 +100,5 @@ if (!input) throw new Error('Attempted to create an Errlop without a input') | ||
Errlop.create = function (input, parent) { | ||
if (parent === void 0) { | ||
parent = null | ||
} | ||
return new this(input, parent) | ||
@@ -99,0 +105,0 @@ } |
# History | ||
## v3.5.0 2020 June 10 | ||
- Support `null` for the `parent` argument to make programatic usage of Errlop easier | ||
- Updated dependencies, [base files](https://github.com/bevry/base), and [editions](https://editions.bevry.me) using [boundation](https://github.com/bevry/boundation) | ||
## v3.4.0 2020 June 10 | ||
@@ -4,0 +9,0 @@ |
{ | ||
"name": "errlop", | ||
"version": "3.4.0", | ||
"version": "3.5.0-next.1591780522.70bd5833390698272d3900a9c1e379b7e3b5481a", | ||
"description": "An extended Error class that envelops a parent error, such that the stack trace contains the causation", | ||
@@ -141,3 +141,3 @@ "homepage": "https://github.com/bevry/errlop", | ||
"eslint": "^7.2.0", | ||
"eslint-config-bevry": "^3.7.0", | ||
"eslint-config-bevry": "^3.8.0", | ||
"eslint-config-prettier": "^6.11.0", | ||
@@ -144,0 +144,0 @@ "eslint-plugin-prettier": "^3.1.3", |
@@ -109,3 +109,3 @@ <!-- TITLE/ --> | ||
``` typescript | ||
import pkg from 'https://unpkg.com/errlop@^3.4.0/edition-deno/index.ts' | ||
import pkg from 'https://unpkg.com/errlop@^3.5.0/edition-deno/index.ts' | ||
``` | ||
@@ -117,3 +117,3 @@ | ||
<script type="module"> | ||
import pkg from '//cdn.pika.dev/errlop/^3.4.0' | ||
import pkg from '//cdn.pika.dev/errlop/^3.5.0' | ||
</script> | ||
@@ -126,3 +126,3 @@ ``` | ||
<script type="module"> | ||
import pkg from '//unpkg.com/errlop@^3.4.0' | ||
import pkg from '//unpkg.com/errlop@^3.5.0' | ||
</script> | ||
@@ -135,3 +135,3 @@ ``` | ||
<script type="module"> | ||
import pkg from '//dev.jspm.io/errlop@3.4.0' | ||
import pkg from '//dev.jspm.io/errlop@3.5.0' | ||
</script> | ||
@@ -138,0 +138,0 @@ ``` |
@@ -39,3 +39,3 @@ type PotentialError = Errlop | Error | ErrorCodeHolder | string | ||
*/ | ||
public parent?: Errlop | Error | ||
public parent?: Errlop | Error | null | ||
@@ -67,3 +67,6 @@ /** An array of all the ancestors. From parent, to grand parent, and so on. */ | ||
*/ | ||
static create(input: PotentialError, parent?: Errlop | Error): Errlop { | ||
static create( | ||
input: PotentialError, | ||
parent: Errlop | Error | null = null | ||
): Errlop { | ||
return new this(input, parent) | ||
@@ -76,3 +79,3 @@ } | ||
*/ | ||
constructor(input: PotentialError, parent?: Errlop | Error) { | ||
constructor(input: PotentialError, parent: Errlop | Error | null = null) { | ||
if (!input) throw new Error('Attempted to create an Errlop without a input') | ||
@@ -79,0 +82,0 @@ |
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
43367
475
1