Page MenuHomeSealhub

import-path.ts
No OneTemporary

import-path.ts

import { relative, dirname } from "path";
import _locreq from "locreq";
const target_locreq = _locreq(process.cwd());
export function importPath(
project_module_path: string,
project_target_path: string
): string {
let result = relative(
dirname(target_locreq.resolve(project_module_path)),
target_locreq.resolve(project_target_path).replace(/.tsx?$/, ".js")
);
if (result[0] != ".") {
result = "./" + result;
}
return result;
}
export function curryImportPath(
project_module_path: string
): (project_target_path: string) => string {
return function (project_target_path: string) {
return importPath(project_module_path, project_target_path);
};
}

File Metadata

Mime Type
text/x-java
Expires
Wed, May 7, 19:47 (1 d, 1 h)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
625037
Default Alt Text
import-path.ts (669 B)

Event Timeline