@thi.ng/errors 2.1.1 → 2.1.4
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 +1 -1
- package/README.md +2 -2
- package/out-of-bounds.d.ts +7 -8
- package/out-of-bounds.js +7 -8
- package/package.json +7 -7
package/CHANGELOG.md
CHANGED
package/README.md
CHANGED
|
@@ -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: 546 bytes
|
|
67
67
|
|
|
68
68
|
## Dependencies
|
|
69
69
|
|
|
@@ -129,4 +129,4 @@ If this project contributes to an academic publication, please cite it as:
|
|
|
129
129
|
|
|
130
130
|
## License
|
|
131
131
|
|
|
132
|
-
© 2018 -
|
|
132
|
+
© 2018 - 2022 Karsten Schmidt // Apache Software License 2.0
|
package/out-of-bounds.d.ts
CHANGED
|
@@ -13,20 +13,19 @@ export declare const outOfBounds: (index: any) => never;
|
|
|
13
13
|
/**
|
|
14
14
|
* Throws an {@link OutOfBoundsError} if `index` outside the `[min..max)` range.
|
|
15
15
|
*
|
|
16
|
-
* @param index
|
|
17
|
-
* @param min
|
|
18
|
-
* @param max
|
|
16
|
+
* @param index -
|
|
17
|
+
* @param min -
|
|
18
|
+
* @param max -
|
|
19
19
|
*/
|
|
20
20
|
export declare const ensureIndex: (index: number, min: number, max: number) => false;
|
|
21
21
|
/**
|
|
22
22
|
* Throws an {@link OutOfBoundsError} if either `x` or `y` is outside their
|
|
23
23
|
* respective `[0..max)` range.
|
|
24
24
|
*
|
|
25
|
-
* @param x
|
|
26
|
-
* @param y
|
|
27
|
-
* @param maxX
|
|
28
|
-
* @param maxY
|
|
29
|
-
* @returns
|
|
25
|
+
* @param x -
|
|
26
|
+
* @param y -
|
|
27
|
+
* @param maxX -
|
|
28
|
+
* @param maxY -
|
|
30
29
|
*/
|
|
31
30
|
export declare const ensureIndex2: (x: number, y: number, maxX: number, maxY: number) => false;
|
|
32
31
|
//# sourceMappingURL=out-of-bounds.d.ts.map
|
package/out-of-bounds.js
CHANGED
|
@@ -6,19 +6,18 @@ export const outOfBounds = (index) => {
|
|
|
6
6
|
/**
|
|
7
7
|
* Throws an {@link OutOfBoundsError} if `index` outside the `[min..max)` range.
|
|
8
8
|
*
|
|
9
|
-
* @param index
|
|
10
|
-
* @param min
|
|
11
|
-
* @param max
|
|
9
|
+
* @param index -
|
|
10
|
+
* @param min -
|
|
11
|
+
* @param max -
|
|
12
12
|
*/
|
|
13
13
|
export const ensureIndex = (index, min, max) => (index < min || index >= max) && outOfBounds(index);
|
|
14
14
|
/**
|
|
15
15
|
* Throws an {@link OutOfBoundsError} if either `x` or `y` is outside their
|
|
16
16
|
* respective `[0..max)` range.
|
|
17
17
|
*
|
|
18
|
-
* @param x
|
|
19
|
-
* @param y
|
|
20
|
-
* @param maxX
|
|
21
|
-
* @param maxY
|
|
22
|
-
* @returns
|
|
18
|
+
* @param x -
|
|
19
|
+
* @param y -
|
|
20
|
+
* @param maxX -
|
|
21
|
+
* @param maxY -
|
|
23
22
|
*/
|
|
24
23
|
export const ensureIndex2 = (x, y, maxX, maxY) => (x < 0 || x >= maxX || y < 0 || y >= maxY) && outOfBounds([x, y]);
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@thi.ng/errors",
|
|
3
|
-
"version": "2.1.
|
|
3
|
+
"version": "2.1.4",
|
|
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.2.
|
|
39
|
-
"@types/node": "^
|
|
37
|
+
"@microsoft/api-extractor": "^7.19.4",
|
|
38
|
+
"@thi.ng/testament": "^0.2.4",
|
|
39
|
+
"@types/node": "^17.0.21",
|
|
40
40
|
"rimraf": "^3.0.2",
|
|
41
41
|
"tools": "^0.0.1",
|
|
42
|
-
"typedoc": "^0.22.
|
|
43
|
-
"typescript": "^4.
|
|
42
|
+
"typedoc": "^0.22.13",
|
|
43
|
+
"typescript": "^4.6.2"
|
|
44
44
|
},
|
|
45
45
|
"keywords": [
|
|
46
46
|
"assert",
|
|
@@ -90,5 +90,5 @@
|
|
|
90
90
|
"thi.ng": {
|
|
91
91
|
"year": 2018
|
|
92
92
|
},
|
|
93
|
-
"gitHead": "
|
|
93
|
+
"gitHead": "0fc692a3225c068aacafdc4cb6140cf603c67ad8\n"
|
|
94
94
|
}
|