@equinor/echo-base
Advanced tools
Comparing version 0.6.1 to 0.6.2
{ | ||
"name": "@equinor/echo-base", | ||
"version": "0.6.1", | ||
"version": "0.6.2", | ||
"module": "esm/index.js", | ||
@@ -16,3 +16,4 @@ "main": "lib/index.js", | ||
"test": "echo \"Run test from root folder\" && exit 1", | ||
"build-docs": "npx typedoc --out docs src/index.ts" | ||
"build-docs": "npx typedoc --out docs src/index.ts", | ||
"echo-update-all": "echo-update -a" | ||
}, | ||
@@ -34,5 +35,5 @@ "keywords": [ | ||
"devDependencies": { | ||
"@types/node": "^14.14.37", | ||
"typedoc": "^0.20.35", | ||
"typescript": "^4.4.4" | ||
"@types/node": "^17.0.12", | ||
"typedoc": "^0.22.11", | ||
"typescript": "^4.5.5" | ||
}, | ||
@@ -47,2 +48,2 @@ "files": [ | ||
} | ||
} | ||
} |
@@ -26,2 +26,14 @@ ![logo](https://raw.githubusercontent.com/equinor/EchoCore/main/doc/ee.png) | ||
It's recommended to create your own error types, extending BaseError, and decorate it with your own fields: | ||
```TS | ||
export class PdfError extends BaseError { | ||
docNo: string; | ||
constructor(args: { message: string; docNo: string; innerError?: Error }) { | ||
super({ name: 'PdfError', message: args.message, innerError: args.innerError }); | ||
this.docNo = args.docNo; | ||
} | ||
} | ||
``` | ||
# Breaking Changes | ||
@@ -35,4 +47,6 @@ | ||
`exception` argument renamed to `innerError`, of type `Record<string, unknown> | Error` | ||
- Moved `EchoEvents` enum to `EchoCore`. | ||
- Changed types for `EventHub` event keys in all functions from `string | EchoEvents` to `string` only. | ||
- `BaseError` doesn't add properties directly onto itself anymore, but uses nested errors with argument `innerError`. | ||
- Instead of `BaseError.allProperties()["someCustomProperty"]` use `BaseError.findPropertyByName("someCustomProperty")`. Since we now use `innerError` of type `Error` or Record<string, unknown>, the property has been moved from baseError[property] to baseError.innerError[property]. | ||
- Moved `EchoEvents` enum to `EchoCore`. | ||
- Changed types for `EventHub` event keys in all functions from `string | EchoEvents` to `string` only. | ||
@@ -39,0 +53,0 @@ v0.5.0: |
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
New author
Supply chain riskA new npm collaborator published a version of the package for the first time. New collaborators are usually benign additions to a project, but do indicate a change to the security surface area of a package.
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
269988
64
1