diff --git a/src/converters/assimp.ts b/src/converters/assimp.ts index 95aa2b9..869f28e 100644 --- a/src/converters/assimp.ts +++ b/src/converters/assimp.ts @@ -1,10 +1,5 @@ import { execFile as execFileOriginal } from "node:child_process"; - -export type ExecFileFn = ( - cmd: string, - args: string[], - callback: (err: Error | null, stdout: string, stderr: string) => void, -) => void; +import { ExecFileFn } from "./types.ts"; export const properties = { from: { @@ -123,7 +118,7 @@ export async function convert( convertTo: string, targetPath: string, options?: unknown, - execFile: ExecFileFn = execFileOriginal, + execFile: ExecFileFn = execFileOriginal, // to make it mockable ): Promise { return new Promise((resolve, reject) => { execFile("assimp", ["export", filePath, targetPath], (error, stdout, stderr) => { diff --git a/src/converters/types.ts b/src/converters/types.ts new file mode 100644 index 0000000..a80a873 --- /dev/null +++ b/src/converters/types.ts @@ -0,0 +1,5 @@ +export type ExecFileFn = ( + cmd: string, + args: string[], + callback: (err: Error | null, stdout: string, stderr: string) => void, +) => void;