@standardserver/shared
Advanced tools
+12
-5
| declare function toArray<T>(value: T): T extends readonly any[] ? T : (T extends undefined | null ? never : T[]); | ||
| declare const PACKAGE_NAME = "@standardserver/shared"; | ||
| declare const PACKAGE_VERSION = "0.0.12"; | ||
| declare const PACKAGE_VERSION = "0.0.15"; | ||
| /** | ||
@@ -38,7 +38,14 @@ * Generates a unique symbol for the specified name within the package scope. | ||
| type AsyncCleanupFnState = { | ||
| kind: 'success'; | ||
| error?: undefined; | ||
| } | { | ||
| kind: 'error'; | ||
| error: unknown; | ||
| } | { | ||
| kind: 'cancelled'; | ||
| error?: unknown; | ||
| }; | ||
| interface AsyncCleanupFn { | ||
| (state: { | ||
| isCancelled: boolean; | ||
| error?: unknown; | ||
| }): Promise<void>; | ||
| (state: AsyncCleanupFnState): Promise<void>; | ||
| } | ||
@@ -45,0 +52,0 @@ |
+12
-5
| declare function toArray<T>(value: T): T extends readonly any[] ? T : (T extends undefined | null ? never : T[]); | ||
| declare const PACKAGE_NAME = "@standardserver/shared"; | ||
| declare const PACKAGE_VERSION = "0.0.12"; | ||
| declare const PACKAGE_VERSION = "0.0.15"; | ||
| /** | ||
@@ -38,7 +38,14 @@ * Generates a unique symbol for the specified name within the package scope. | ||
| type AsyncCleanupFnState = { | ||
| kind: 'success'; | ||
| error?: undefined; | ||
| } | { | ||
| kind: 'error'; | ||
| error: unknown; | ||
| } | { | ||
| kind: 'cancelled'; | ||
| error?: unknown; | ||
| }; | ||
| interface AsyncCleanupFn { | ||
| (state: { | ||
| isCancelled: boolean; | ||
| error?: unknown; | ||
| }): Promise<void>; | ||
| (state: AsyncCleanupFnState): Promise<void>; | ||
| } | ||
@@ -45,0 +52,0 @@ |
+5
-5
@@ -6,3 +6,3 @@ function toArray(value) { | ||
| const PACKAGE_NAME = "@standardserver/shared"; | ||
| const PACKAGE_VERSION = "0.0.12"; | ||
| const PACKAGE_VERSION = "0.0.15"; | ||
| function getPackageSymbol(name) { | ||
@@ -76,3 +76,3 @@ return Symbol.for(`${PACKAGE_NAME}@${PACKAGE_VERSION}/${name}`); | ||
| this.isExecuteComplete = true; | ||
| await this.cleanup(errorRef ? { isCancelled: false, error: errorRef.value } : { isCancelled: false }); | ||
| await this.cleanup(errorRef ? { kind: "error", error: errorRef.value } : { kind: "success" }); | ||
| } | ||
@@ -86,3 +86,3 @@ } | ||
| this.isExecuteComplete = true; | ||
| await this.cleanup({ isCancelled: true }); | ||
| await this.cleanup({ kind: "cancelled" }); | ||
| } | ||
@@ -95,3 +95,3 @@ return { done: true, value }; | ||
| this.isExecuteComplete = true; | ||
| await this.cleanup({ isCancelled: true, error }); | ||
| await this.cleanup({ kind: "cancelled", error }); | ||
| } | ||
@@ -107,3 +107,3 @@ throw error; | ||
| this.isExecuteComplete = true; | ||
| await this.cleanup({ isCancelled: true }); | ||
| await this.cleanup({ kind: "cancelled" }); | ||
| } | ||
@@ -110,0 +110,0 @@ } |
+1
-1
| { | ||
| "name": "@standardserver/shared", | ||
| "type": "module", | ||
| "version": "0.0.12", | ||
| "version": "0.0.15", | ||
| "license": "MIT", | ||
@@ -6,0 +6,0 @@ "homepage": "https://standardserver.dev", |
18196
1.38%357
2%