@ls-stack/utils 3.3.0 → 3.3.2
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/lib/safeJson.d.cts +1 -1
- package/lib/safeJson.d.ts +1 -1
- package/lib/tsResult.d.cts +1 -1
- package/lib/tsResult.d.ts +1 -1
- package/package.json +1 -1
package/lib/safeJson.d.cts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
/** JSON.stringify can throw if the value is circular or contains functions, this function catches those errors and returns undefined */
|
|
2
2
|
declare function safeJsonStringify(value: unknown): string | undefined;
|
|
3
3
|
/** JSON.parse can throw if the value is not valid JSON, this function catches those errors and returns undefined */
|
|
4
|
-
declare function safeJsonParse(value: string):
|
|
4
|
+
declare function safeJsonParse(value: string): unknown;
|
|
5
5
|
|
|
6
6
|
export { safeJsonParse, safeJsonStringify };
|
package/lib/safeJson.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
/** JSON.stringify can throw if the value is circular or contains functions, this function catches those errors and returns undefined */
|
|
2
2
|
declare function safeJsonStringify(value: unknown): string | undefined;
|
|
3
3
|
/** JSON.parse can throw if the value is not valid JSON, this function catches those errors and returns undefined */
|
|
4
|
-
declare function safeJsonParse(value: string):
|
|
4
|
+
declare function safeJsonParse(value: string): unknown;
|
|
5
5
|
|
|
6
6
|
export { safeJsonParse, safeJsonStringify };
|
package/lib/tsResult.d.cts
CHANGED
|
@@ -4,7 +4,7 @@ type Ok<T> = {
|
|
|
4
4
|
value: T;
|
|
5
5
|
} & AnyResultMethods;
|
|
6
6
|
type AnyResultMethods = Record<ResultMethodsKeys, never>;
|
|
7
|
-
type ResultValidErrors = Error | Record<string, unknown> | unknown[] | true;
|
|
7
|
+
type ResultValidErrors = Error | Record<string, unknown> | unknown[] | readonly unknown[] | true;
|
|
8
8
|
type Err<E extends ResultValidErrors> = {
|
|
9
9
|
ok: false;
|
|
10
10
|
error: E;
|
package/lib/tsResult.d.ts
CHANGED
|
@@ -4,7 +4,7 @@ type Ok<T> = {
|
|
|
4
4
|
value: T;
|
|
5
5
|
} & AnyResultMethods;
|
|
6
6
|
type AnyResultMethods = Record<ResultMethodsKeys, never>;
|
|
7
|
-
type ResultValidErrors = Error | Record<string, unknown> | unknown[] | true;
|
|
7
|
+
type ResultValidErrors = Error | Record<string, unknown> | unknown[] | readonly unknown[] | true;
|
|
8
8
|
type Err<E extends ResultValidErrors> = {
|
|
9
9
|
ok: false;
|
|
10
10
|
error: E;
|