@thi.ng/errors 2.1.10 → 2.2.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +9 -1
- package/README.md +4 -4
- package/index.d.ts +1 -0
- package/index.js +1 -0
- package/io.d.ts +24 -0
- package/io.js +9 -0
- package/package.json +9 -6
package/CHANGELOG.md
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
# Change Log
|
|
2
2
|
|
|
3
|
-
- **Last updated**: 2022-
|
|
3
|
+
- **Last updated**: 2022-10-03T16:07:55Z
|
|
4
4
|
- **Generator**: [thi.ng/monopub](https://thi.ng/monopub)
|
|
5
5
|
|
|
6
6
|
All notable changes to this project will be documented in this file.
|
|
@@ -9,6 +9,14 @@ See [Conventional Commits](https://conventionalcommits.org/) for commit guidelin
|
|
|
9
9
|
**Note:** Unlisted _patch_ versions only involve non-code or otherwise excluded changes
|
|
10
10
|
and/or version bumps of transitive dependencies.
|
|
11
11
|
|
|
12
|
+
## [2.2.0](https://github.com/thi-ng/umbrella/tree/@thi.ng/errors@2.2.0) (2022-09-21)
|
|
13
|
+
|
|
14
|
+
#### 🚀 Features
|
|
15
|
+
|
|
16
|
+
- add I/O error types & factories ([898584b](https://github.com/thi-ng/umbrella/commit/898584b))
|
|
17
|
+
- add IOError
|
|
18
|
+
- add FileNotFoundError
|
|
19
|
+
|
|
12
20
|
## [2.1.0](https://github.com/thi-ng/umbrella/tree/@thi.ng/errors@2.1.0) (2021-11-17)
|
|
13
21
|
|
|
14
22
|
#### 🚀 Features
|
package/README.md
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
<!-- This file is generated - DO NOT EDIT! -->
|
|
2
2
|
|
|
3
|
-
# 
|
|
4
4
|
|
|
5
5
|
[](https://www.npmjs.com/package/@thi.ng/errors)
|
|
6
6
|

|
|
@@ -10,7 +10,7 @@ This project is part of the
|
|
|
10
10
|
[@thi.ng/umbrella](https://github.com/thi-ng/umbrella/) monorepo.
|
|
11
11
|
|
|
12
12
|
- [About](#about)
|
|
13
|
-
|
|
13
|
+
- [Status](#status)
|
|
14
14
|
- [Installation](#installation)
|
|
15
15
|
- [Dependencies](#dependencies)
|
|
16
16
|
- [API](#api)
|
|
@@ -34,7 +34,7 @@ This package defines the following error types & helper functions to throw them:
|
|
|
34
34
|
Custom error types can be easily defined using
|
|
35
35
|
[`defError()`](https://github.com/thi-ng/umbrella/tree/develop/packages/errors/src/deferror.ts).
|
|
36
36
|
|
|
37
|
-
|
|
37
|
+
## Status
|
|
38
38
|
|
|
39
39
|
**STABLE** - used in production
|
|
40
40
|
|
|
@@ -63,7 +63,7 @@ node --experimental-repl-await
|
|
|
63
63
|
> const errors = await import("@thi.ng/errors");
|
|
64
64
|
```
|
|
65
65
|
|
|
66
|
-
Package sizes (gzipped, pre-treeshake): ESM:
|
|
66
|
+
Package sizes (gzipped, pre-treeshake): ESM: 608 bytes
|
|
67
67
|
|
|
68
68
|
## Dependencies
|
|
69
69
|
|
package/index.d.ts
CHANGED
|
@@ -3,6 +3,7 @@ export * from "./assert.js";
|
|
|
3
3
|
export * from "./illegal-arguments.js";
|
|
4
4
|
export * from "./illegal-arity.js";
|
|
5
5
|
export * from "./illegal-state.js";
|
|
6
|
+
export * from "./io.js";
|
|
6
7
|
export * from "./out-of-bounds.js";
|
|
7
8
|
export * from "./unsupported.js";
|
|
8
9
|
//# sourceMappingURL=index.d.ts.map
|
package/index.js
CHANGED
package/io.d.ts
ADDED
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
/// <reference types="node" />
|
|
2
|
+
export declare const IOError: {
|
|
3
|
+
new (msg?: any): {
|
|
4
|
+
name: string;
|
|
5
|
+
message: string;
|
|
6
|
+
stack?: string | undefined;
|
|
7
|
+
};
|
|
8
|
+
captureStackTrace(targetObject: object, constructorOpt?: Function | undefined): void;
|
|
9
|
+
prepareStackTrace?: ((err: Error, stackTraces: NodeJS.CallSite[]) => any) | undefined;
|
|
10
|
+
stackTraceLimit: number;
|
|
11
|
+
};
|
|
12
|
+
export declare const ioerror: (msg?: any) => never;
|
|
13
|
+
export declare const FileNotFoundError: {
|
|
14
|
+
new (msg?: any): {
|
|
15
|
+
name: string;
|
|
16
|
+
message: string;
|
|
17
|
+
stack?: string | undefined;
|
|
18
|
+
};
|
|
19
|
+
captureStackTrace(targetObject: object, constructorOpt?: Function | undefined): void;
|
|
20
|
+
prepareStackTrace?: ((err: Error, stackTraces: NodeJS.CallSite[]) => any) | undefined;
|
|
21
|
+
stackTraceLimit: number;
|
|
22
|
+
};
|
|
23
|
+
export declare const fileNotFound: (path: string) => never;
|
|
24
|
+
//# sourceMappingURL=io.d.ts.map
|
package/io.js
ADDED
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { defError } from "./deferror.js";
|
|
2
|
+
export const IOError = defError(() => "IO error");
|
|
3
|
+
export const ioerror = (msg) => {
|
|
4
|
+
throw new IOError(msg);
|
|
5
|
+
};
|
|
6
|
+
export const FileNotFoundError = defError(() => "File not found");
|
|
7
|
+
export const fileNotFound = (path) => {
|
|
8
|
+
throw new FileNotFoundError(path);
|
|
9
|
+
};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@thi.ng/errors",
|
|
3
|
-
"version": "2.1
|
|
3
|
+
"version": "2.2.1",
|
|
4
4
|
"description": "Custom error types and error factory functions",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"module": "./index.js",
|
|
@@ -34,13 +34,13 @@
|
|
|
34
34
|
"test": "testament test"
|
|
35
35
|
},
|
|
36
36
|
"devDependencies": {
|
|
37
|
-
"@microsoft/api-extractor": "^7.
|
|
38
|
-
"@thi.ng/testament": "^0.
|
|
39
|
-
"@types/node": "^18.
|
|
37
|
+
"@microsoft/api-extractor": "^7.31.1",
|
|
38
|
+
"@thi.ng/testament": "^0.3.1",
|
|
39
|
+
"@types/node": "^18.7.18",
|
|
40
40
|
"rimraf": "^3.0.2",
|
|
41
41
|
"tools": "^0.0.1",
|
|
42
42
|
"typedoc": "^0.22.17",
|
|
43
|
-
"typescript": "^4.
|
|
43
|
+
"typescript": "^4.8.3"
|
|
44
44
|
},
|
|
45
45
|
"keywords": [
|
|
46
46
|
"assert",
|
|
@@ -80,6 +80,9 @@
|
|
|
80
80
|
"./illegal-state": {
|
|
81
81
|
"default": "./illegal-state.js"
|
|
82
82
|
},
|
|
83
|
+
"./io": {
|
|
84
|
+
"default": "./io.js"
|
|
85
|
+
},
|
|
83
86
|
"./out-of-bounds": {
|
|
84
87
|
"default": "./out-of-bounds.js"
|
|
85
88
|
},
|
|
@@ -90,5 +93,5 @@
|
|
|
90
93
|
"thi.ng": {
|
|
91
94
|
"year": 2018
|
|
92
95
|
},
|
|
93
|
-
"gitHead": "
|
|
96
|
+
"gitHead": "8600007d81a7dc92634a1d54e2c32b14ab30ba80\n"
|
|
94
97
|
}
|