@dereekb/util 10.1.3 → 10.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.
@@ -2,6 +2,10 @@
2
2
 
3
3
  This file was generated using [@jscutlery/semver](https://github.com/jscutlery/semver).
4
4
 
5
+ ## [10.1.4](https://github.com/dereekb/dbx-components/compare/v10.1.3-dev...v10.1.4) (2024-03-14)
6
+
7
+
8
+
5
9
  ## [10.1.3](https://github.com/dereekb/dbx-components/compare/v10.1.2-dev...v10.1.3) (2024-03-11)
6
10
 
7
11
 
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@dereekb/util/fetch",
3
- "version": "10.1.3",
3
+ "version": "10.1.4",
4
4
  "type": "commonjs",
5
5
  "peerDependencies": {
6
6
  "@dereekb/util": "*"
package/index.cjs.js CHANGED
@@ -10490,12 +10490,6 @@ function readableError(code, message) {
10490
10490
  message
10491
10491
  };
10492
10492
  }
10493
- /**
10494
- * Converts the input error content to a ReadableError or CodedError.
10495
- *
10496
- * @param inputError
10497
- * @returns
10498
- */
10499
10493
  function toReadableError(inputError) {
10500
10494
  let error;
10501
10495
  if (inputError) {
package/index.esm.js CHANGED
@@ -13158,12 +13158,14 @@ function readableError(code, message) {
13158
13158
  message
13159
13159
  };
13160
13160
  }
13161
+
13161
13162
  /**
13162
13163
  * Converts the input error content to a ReadableError or CodedError.
13163
13164
  *
13164
13165
  * @param inputError
13165
13166
  * @returns
13166
13167
  */
13168
+
13167
13169
  function toReadableError(inputError) {
13168
13170
  let error;
13169
13171
  if (inputError) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@dereekb/util",
3
- "version": "10.1.3",
3
+ "version": "10.1.4",
4
4
  "exports": {
5
5
  ".": {
6
6
  "types": "./src/index.d.ts",
@@ -12,23 +12,23 @@ export declare const DEFAULT_READABLE_ERROR_CODE = "ERROR";
12
12
  * An error that is identified by a unique code.
13
13
  */
14
14
  export interface CodedError {
15
- code: StringErrorCode;
15
+ readonly code: StringErrorCode;
16
16
  /**
17
17
  * The original error, if available.
18
18
  */
19
- _error?: unknown;
19
+ readonly _error?: unknown;
20
20
  }
21
21
  /**
22
22
  * An error with a human-readable message.
23
23
  */
24
24
  export interface ReadableError extends Partial<CodedError> {
25
- message?: Maybe<string>;
25
+ readonly message?: Maybe<string>;
26
26
  }
27
27
  export declare function isDefaultReadableError(error: Maybe<ReadableError | StringErrorCode>): boolean;
28
28
  export type ReadableErrorWithCode<T extends ReadableError = ReadableError> = T & CodedError;
29
29
  export declare function readableError(code: StringErrorCode, message?: string): ReadableErrorWithCode;
30
30
  export interface ReadableDataError<T = unknown> extends ReadableError {
31
- data?: T;
31
+ readonly data?: T;
32
32
  }
33
33
  export interface ErrorWrapper {
34
34
  data: ReadableError | CodedError;
@@ -40,6 +40,7 @@ export type ErrorInput = ErrorWrapper | CodedError | ReadableError | ReadableDat
40
40
  * @param inputError
41
41
  * @returns
42
42
  */
43
+ export declare function toReadableError(inputError: ErrorInput): CodedError | ReadableErrorWithCode;
43
44
  export declare function toReadableError(inputError: Maybe<ErrorInput>): Maybe<CodedError | ReadableErrorWithCode>;
44
45
  export declare function errorMessageContainsString(input: Maybe<ErrorInput | string>, target: string): boolean;
45
46
  export type ErrorMessageContainsStringFunction = (input: Maybe<ErrorInput | string>) => boolean;
package/test/CHANGELOG.md CHANGED
@@ -2,6 +2,10 @@
2
2
 
3
3
  This file was generated using [@jscutlery/semver](https://github.com/jscutlery/semver).
4
4
 
5
+ ## [10.1.4](https://github.com/dereekb/dbx-components/compare/v10.1.3-dev...v10.1.4) (2024-03-14)
6
+
7
+
8
+
5
9
  ## [10.1.3](https://github.com/dereekb/dbx-components/compare/v10.1.2-dev...v10.1.3) (2024-03-11)
6
10
 
7
11
 
package/test/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@dereekb/util/test",
3
- "version": "10.1.3",
3
+ "version": "10.1.4",
4
4
  "type": "commonjs",
5
5
  "peerDependencies": {
6
6
  "@dereekb/util": "*"