cleanup tests, codegen, and importing handler

This commit is contained in:
jacob
2024-05-02 17:27:57 -05:00
parent d3245c8a0c
commit d7ebdb2edc
10 changed files with 30 additions and 103 deletions

View File

@@ -3,10 +3,10 @@ import assert from 'assert';
import { existsSync } from 'fs';
export const parseCallsite = (fpath: string) => {
const pathobj = path.parse(fpath.replace(/file:\\?/, "")
.split(path.sep)
.join(path.posix.sep))
export const parseCallsite = (site: string) => {
const pathobj = path.parse(site.replace(/file:\\?/, "")
.split(path.sep)
.join(path.posix.sep))
return { name: pathobj.name,
absPath : path.posix.format(pathobj) }
}
@@ -16,7 +16,7 @@ export const shouldHandle = (pth: string, filenam: string) => {
let newPath = path.join(path.dirname(pth), file_name)
.replace(/file:\\?/, "");
return { exists: existsSync(newPath),
path: 'file:///'+newPath };
path: 'file://'+newPath };
}