feat: types organization and cleaning up code base

This commit is contained in:
Jacob Nguyen
2023-05-09 22:49:29 -05:00
parent cd1568ff69
commit 8a537d670b
39 changed files with 591 additions and 536 deletions

View File

@@ -1,14 +1,15 @@
import { SernError } from './structures/errors';
import { type Result, Err, Ok } from 'ts-results-es';
import { Processed } from '../types/core';
import { Module } from '../types/module';
import { Module } from './types/modules';
import * as assert from 'node:assert';
import util from 'node:util';
import { type Observable, from, mergeMap, ObservableInput } from 'rxjs';
import { readdir, stat } from 'fs/promises';
import { basename, join, resolve } from 'path';
import { Processed } from '../handler/types';
export type ModuleResult<T> = Promise<Result<Processed<T>, SernError>>;
export async function importModule<T>(absPath: string) {
/// #if MODE === 'esm'
return import(absPath).then(i => i.default as T);