Commit cb54037

Anton Golub <antongolub@antongolub.com>
2025-06-22 16:01:38
chore: internal types improvements
1 parent f533385
build/core.cjs
@@ -549,8 +549,7 @@ var _ProcessPromise = class _ProcessPromise extends Promise {
           ctx.cmd = self.fullCmd;
           cb();
         }, (error) => {
-          var _a3, _b3;
-          (_b3 = (_a3 = ctx.on).end) == null ? void 0 : _b3.call(_a3, { error, status: null, signal: null, duration: 0, ctx }, ctx);
+          ctx.on.end({ error, status: null, signal: null, duration: 0, ctx }, ctx);
         })) || cb();
       },
       on: {
build/vendor-core.d.ts
@@ -272,7 +272,7 @@ export type TSpawnStore = {
 	stderr: TSpawnStoreChunks;
 	stdall: TSpawnStoreChunks;
 };
-type TSpawnResult = {
+export type TSpawnResult = {
 	stderr: string;
 	stdout: string;
 	stdall: string;
src/core.ts
@@ -43,6 +43,7 @@ import {
   ps,
   VoidStream,
   type TSpawnStore,
+  type TSpawnResult,
 } from './vendor-core.ts'
 import {
   type Duration,
@@ -316,7 +317,7 @@ export class ProcessPromise extends Promise<ProcessOutput> {
           ctx.cmd = self.fullCmd
           cb()
         }, error => {
-          ctx.on.end?.({error, status: null, signal: null, duration: 0, ctx} as Parameters<typeof ctx.on.end>[0], ctx)
+          ctx.on.end!({error, status: null, signal: null, duration: 0, ctx} as TSpawnResult, ctx)
         }) || cb()
       },
       on: {
src/vendor-core.ts
@@ -20,6 +20,7 @@ import { bus } from './internals.ts'
 export {
   type TSpawnStore,
   type TSpawnStoreChunks,
+  type TSpawnResult,
   exec,
   buildCmd,
   isStringLiteral,
.size-limit.json
@@ -15,7 +15,7 @@
       "README.md",
       "LICENSE"
     ],
-    "limit": "121.15 kB",
+    "limit": "121.10 kB",
     "brotli": false,
     "gzip": false
   },
@@ -29,7 +29,7 @@
       "build/globals.js",
       "build/deno.js"
     ],
-    "limit": "812.20 kB",
+    "limit": "812.15 kB",
     "brotli": false,
     "gzip": false
   },
@@ -62,7 +62,7 @@
       "README.md",
       "LICENSE"
     ],
-    "limit": "867.70 kB",
+    "limit": "867.65 kB",
     "brotli": false,
     "gzip": false
   }