@jamashita/anden-error
Advanced tools
Comparing version 1.8.0 to 1.9.0
@@ -5,5 +5,5 @@ import { RuntimeError } from './RuntimeError'; | ||
private readonly errors; | ||
private static getMessage; | ||
static of<ET extends Error>(errors: Iterable<ET>): Errors<ET>; | ||
static ofSpread<ET extends Error>(...errors: ReadonlyArray<ET>): Errors<ET>; | ||
private static getMessage; | ||
constructor(errors: ReadonlyArray<E>); | ||
@@ -10,0 +10,0 @@ [Symbol.iterator](): Iterator<E>; |
@@ -12,2 +12,7 @@ "use strict"; | ||
} | ||
static getMessage(errors) { | ||
return errors.map((error) => { | ||
return error.message; | ||
}).join('\n'); | ||
} | ||
static of(errors) { | ||
@@ -19,7 +24,2 @@ return new Errors([...errors]); | ||
} | ||
static getMessage(errors) { | ||
return errors.map((error) => { | ||
return error.message; | ||
}).join('\n'); | ||
} | ||
[Symbol.iterator]() { | ||
@@ -26,0 +26,0 @@ return this.errors[Symbol.iterator](); |
@@ -5,5 +5,5 @@ import { RuntimeError } from './RuntimeError'; | ||
private readonly errors; | ||
private static getMessage; | ||
static of<ET extends Error>(errors: Iterable<ET>): Errors<ET>; | ||
static ofSpread<ET extends Error>(...errors: ReadonlyArray<ET>): Errors<ET>; | ||
private static getMessage; | ||
constructor(errors: ReadonlyArray<E>); | ||
@@ -10,0 +10,0 @@ [Symbol.iterator](): Iterator<E>; |
@@ -9,2 +9,7 @@ import { Kind } from '@jamashita/anden-type'; | ||
} | ||
static getMessage(errors) { | ||
return errors.map((error) => { | ||
return error.message; | ||
}).join('\n'); | ||
} | ||
static of(errors) { | ||
@@ -16,7 +21,2 @@ return new Errors([...errors]); | ||
} | ||
static getMessage(errors) { | ||
return errors.map((error) => { | ||
return error.message; | ||
}).join('\n'); | ||
} | ||
[Symbol.iterator]() { | ||
@@ -23,0 +23,0 @@ return this.errors[Symbol.iterator](); |
{ | ||
"name": "@jamashita/anden-error", | ||
"version": "1.8.0", | ||
"version": "1.9.0", | ||
"private": false, | ||
@@ -29,3 +29,3 @@ "repository": { | ||
"dependencies": { | ||
"@jamashita/anden-type": "^1.9.0", | ||
"@jamashita/anden-type": "^1.10.1", | ||
"make-error-cause": "2.3.0" | ||
@@ -32,0 +32,0 @@ }, |
@@ -8,2 +8,8 @@ import { Ambiguous, Kind } from '@jamashita/anden-type'; | ||
private static getMessage<ET extends Error>(errors: ReadonlyArray<ET>): string { | ||
return errors.map<string>((error: Error) => { | ||
return error.message; | ||
}).join('\n'); | ||
} | ||
public static of<ET extends Error>(errors: Iterable<ET>): Errors<ET> { | ||
@@ -17,8 +23,2 @@ return new Errors<ET>([...errors]); | ||
private static getMessage<ET extends Error>(errors: ReadonlyArray<ET>): string { | ||
return errors.map<string>((error: Error) => { | ||
return error.message; | ||
}).join('\n'); | ||
} | ||
public constructor(errors: ReadonlyArray<E>) { | ||
@@ -25,0 +25,0 @@ super(Errors.getMessage(errors)); |
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
Sorry, the diff of this file is not supported yet
180974
58