@zokugun/xtry 0.9.1 → 0.10.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/lib/cjs/json.d.cts +2 -2
- package/lib/cjs/tryify.d.cts +4 -4
- package/lib/esm/json.d.mts +2 -2
- package/lib/esm/tryify.d.mts +4 -4
- package/package.json +3 -4
package/lib/cjs/json.d.cts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export declare const parseJson: (
|
|
2
|
-
export declare const parseJSON: (
|
|
1
|
+
export declare const parseJson: (...args: unknown[]) => import("./tryify.cjs").SyncResult<any, SyntaxError>;
|
|
2
|
+
export declare const parseJSON: (...args: unknown[]) => import("./tryify.cjs").SyncResult<any, SyntaxError>;
|
package/lib/cjs/tryify.d.cts
CHANGED
|
@@ -38,8 +38,8 @@ export type SyncIteratorElement<T> = T extends Iterator<infer E> ? E : T extends
|
|
|
38
38
|
} ? SyncIteratorElement<I> : unknown;
|
|
39
39
|
export type SyncResult<T extends (...args: unknown[]) => NotPromise<unknown>, Err extends Error> = Result<ReturnType<T>, Err>;
|
|
40
40
|
export type SyncIteratableResult<T extends (...args: unknown[]) => unknown, Err extends Error> = Iterable<Result<SyncIteratorElement<ReturnType<T>>, Err>, unknown, unknown>;
|
|
41
|
-
export declare function xtryifyAsync<
|
|
42
|
-
export declare function xtryifyAsyncIterable<
|
|
43
|
-
export declare function xtryifySync<
|
|
44
|
-
export declare function xtryifySyncIterable<
|
|
41
|
+
export declare function xtryifyAsync<Err extends Error, Fn extends AnyAsyncFunction = any>(fn: AsyncFunction<Fn>): PreserveAsyncOverloads<Fn, Err>;
|
|
42
|
+
export declare function xtryifyAsyncIterable<Err extends Error, Fn extends AsyncIterableFunction = any>(fn: Fn): PreserveAsyncIterableOverloads<Fn, Err>;
|
|
43
|
+
export declare function xtryifySync<Err extends Error, Fn extends AnySyncFunction = any>(fn: SyncFunction<Fn>): PreserveSyncOverloads<Fn, Err>;
|
|
44
|
+
export declare function xtryifySyncIterable<Err extends Error, Fn extends SyncIterableFunction = any>(fn: Fn): PreserveSyncIterableOverloads<Fn, Err>;
|
|
45
45
|
export {};
|
package/lib/esm/json.d.mts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export declare const parseJson: (
|
|
2
|
-
export declare const parseJSON: (
|
|
1
|
+
export declare const parseJson: (...args: unknown[]) => import("./tryify.mjs").SyncResult<any, SyntaxError>;
|
|
2
|
+
export declare const parseJSON: (...args: unknown[]) => import("./tryify.mjs").SyncResult<any, SyntaxError>;
|
package/lib/esm/tryify.d.mts
CHANGED
|
@@ -38,8 +38,8 @@ export type SyncIteratorElement<T> = T extends Iterator<infer E> ? E : T extends
|
|
|
38
38
|
} ? SyncIteratorElement<I> : unknown;
|
|
39
39
|
export type SyncResult<T extends (...args: unknown[]) => NotPromise<unknown>, Err extends Error> = Result<ReturnType<T>, Err>;
|
|
40
40
|
export type SyncIteratableResult<T extends (...args: unknown[]) => unknown, Err extends Error> = Iterable<Result<SyncIteratorElement<ReturnType<T>>, Err>, unknown, unknown>;
|
|
41
|
-
export declare function xtryifyAsync<
|
|
42
|
-
export declare function xtryifyAsyncIterable<
|
|
43
|
-
export declare function xtryifySync<
|
|
44
|
-
export declare function xtryifySyncIterable<
|
|
41
|
+
export declare function xtryifyAsync<Err extends Error, Fn extends AnyAsyncFunction = any>(fn: AsyncFunction<Fn>): PreserveAsyncOverloads<Fn, Err>;
|
|
42
|
+
export declare function xtryifyAsyncIterable<Err extends Error, Fn extends AsyncIterableFunction = any>(fn: Fn): PreserveAsyncIterableOverloads<Fn, Err>;
|
|
43
|
+
export declare function xtryifySync<Err extends Error, Fn extends AnySyncFunction = any>(fn: SyncFunction<Fn>): PreserveSyncOverloads<Fn, Err>;
|
|
44
|
+
export declare function xtryifySyncIterable<Err extends Error, Fn extends SyncIterableFunction = any>(fn: Fn): PreserveSyncIterableOverloads<Fn, Err>;
|
|
45
45
|
export {};
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@zokugun/xtry",
|
|
3
3
|
"description": "simple try/catch wrapper returning Result",
|
|
4
|
-
"version": "0.
|
|
4
|
+
"version": "0.10.1",
|
|
5
5
|
"author": {
|
|
6
6
|
"name": "Baptiste Augrain",
|
|
7
7
|
"email": "daiyam@zokugun.org"
|
|
@@ -83,14 +83,13 @@
|
|
|
83
83
|
"@commitlint/config-conventional": "^19.7.1",
|
|
84
84
|
"@types/fs-extra": "^11.0.4",
|
|
85
85
|
"@types/node": "^20.14.8",
|
|
86
|
-
"@zokugun/tsc-leda": "^0.1.
|
|
87
|
-
"commitizen": "^4.3.1",
|
|
86
|
+
"@zokugun/tsc-leda": "^0.1.1",
|
|
88
87
|
"fixpack": "^4.0.0",
|
|
89
88
|
"fs-extra": "^11.3.3",
|
|
90
89
|
"globby": "^16.1.0",
|
|
91
90
|
"husky": "^9.1.7",
|
|
92
91
|
"lint-staged": "^16.1.4",
|
|
93
|
-
"release-it": "^
|
|
92
|
+
"release-it": "^19.2.4",
|
|
94
93
|
"tsc-watch": "^6.3.0",
|
|
95
94
|
"typescript": "^5.7.3",
|
|
96
95
|
"vitest": "^4.0.16",
|