diff --git a/src/core/module-loading.ts b/src/core/module-loading.ts index ef14536..05bea88 100644 --- a/src/core/module-loading.ts +++ b/src/core/module-loading.ts @@ -9,7 +9,6 @@ import { readdir, stat } from 'fs/promises'; import { basename, join, resolve } from 'path'; export type ModuleResult = Promise, SernError>>; -export type Loader = (absPath: string) => ModuleResult; export async function importModule(absPath: string) { /// #if MODE === 'esm' return import(absPath).then(i => i.default as T); @@ -29,7 +28,7 @@ export async function defaultModuleLoader(absPath: string): Mo function checkIsProcessed(m: T): asserts m is Processed { assert.ok(m.name !== undefined, `name is not defined for ${util.format(m)}`); - assert.ok(m.description !== undefined, `description is not defined for ${util.format}`); + assert.ok(m.description !== undefined, `description is not defined for ${util.format(m)}`); } export const fmtFileName = (n: string) => n.substring(0, n.length - 3); @@ -45,7 +44,7 @@ export function buildModuleStream( return from(input).pipe(mergeMap(defaultModuleLoader)); } -export function getCommands(dir: string) { +export function getFullPathTree(dir: string) { return readPath(resolve(dir)); }