mirror of
https://gitea.toothfairyai.com/ToothFairyAI/tf_code.git
synced 2026-04-02 07:03:45 +00:00
11 lines
255 B
TypeScript
11 lines
255 B
TypeScript
import { createRequire } from "node:module"
|
|
import path from "node:path"
|
|
|
|
export namespace Module {
|
|
export function resolve(id: string, dir: string) {
|
|
try {
|
|
return createRequire(path.join(dir, "package.json")).resolve(id)
|
|
} catch {}
|
|
}
|
|
}
|