1
0
mirror of https://git.tuxpa.in/a/code-server.git synced 2025-01-06 00:38:46 +00:00
code-server-2/packages/vscode/src/fill/amd.ts

12 lines
391 B
TypeScript
Raw Normal View History

import { URI } from "vs/base/common/uri";
export const getPathFromAmdModule = (_: typeof require, relativePath: string): string => {
if (process.mainModule && process.mainModule.filename) {
const index = process.mainModule.filename.lastIndexOf("/");
return process.mainModule.filename.slice(0, index);
}
return relativePath ? URI.parse(require.toUrl(relativePath)).fsPath : "";
};