BLUE
PHP 7.4.33
Path:
/var/www/uibuilder.cmshelp.dk/httpdocs/node_modules/tsconfig-paths/src
Run
Logout
Edit File
Size: 2.48 KB
Close
/var/www/uibuilder.cmshelp.dk/httpdocs/node_modules/tsconfig-paths/src/register.ts
Text
Base64
import { createMatchPath } from "./match-path-sync"; import { configLoader, ExplicitParams } from "./config-loader"; import { options } from "./options"; const noOp = (): void => void 0; function getCoreModules( builtinModules: string[] | undefined ): { [key: string]: boolean } { builtinModules = builtinModules || [ "assert", "buffer", "child_process", "cluster", "crypto", "dgram", "dns", "domain", "events", "fs", "http", "https", "net", "os", "path", "punycode", "querystring", "readline", "stream", "string_decoder", "tls", "tty", "url", "util", "v8", "vm", "zlib", ]; const coreModules: { [key: string]: boolean } = {}; for (let module of builtinModules) { coreModules[module] = true; } return coreModules; } /** * Installs a custom module load function that can adhere to paths in tsconfig. * Returns a function to undo paths registration. */ export function register(explicitParams: ExplicitParams): () => void { const configLoaderResult = configLoader({ cwd: options.cwd, explicitParams, }); if (configLoaderResult.resultType === "failed") { console.warn( `${configLoaderResult.message}. tsconfig-paths will be skipped` ); return noOp; } const matchPath = createMatchPath( configLoaderResult.absoluteBaseUrl, configLoaderResult.paths, configLoaderResult.mainFields, configLoaderResult.addMatchAll ); // Patch node's module loading // tslint:disable-next-line:no-require-imports variable-name const Module = require("module"); const originalResolveFilename = Module._resolveFilename; const coreModules = getCoreModules(Module.builtinModules); // tslint:disable-next-line:no-any Module._resolveFilename = function (request: string, _parent: any): string { const isCoreModule = coreModules.hasOwnProperty(request); if (!isCoreModule) { const found = matchPath(request); if (found) { const modifiedArguments = [found, ...[].slice.call(arguments, 1)]; // Passes all arguments. Even those that is not specified above. // tslint:disable-next-line:no-invalid-this return originalResolveFilename.apply(this, modifiedArguments); } } // tslint:disable-next-line:no-invalid-this return originalResolveFilename.apply(this, arguments); }; return () => { // Return node's module loading to original state. Module._resolveFilename = originalResolveFilename; }; }
Save
Close
Exit & Reset
Text mode: syntax highlighting auto-detects file type.
Directory Contents
Dirs: 1 × Files: 10
Delete Selected
Select All
Select None
Sort:
Name
Size
Modified
Enable drag-to-move
Name
Size
Perms
Modified
Actions
__tests__
DIR
-
drwxr-xr-x
2025-03-28 11:04:37
Edit
Download
Rename
Chmod
Change Date
Delete
OK
Cancel
recursive
OK
Cancel
recursive
OK
Cancel
config-loader.ts
2.41 KB
lrw-r--r--
2025-03-28 11:04:37
Edit
Download
Rename
Chmod
Change Date
Delete
OK
Cancel
recursive
OK
Cancel
recursive
OK
Cancel
filesystem.ts
2.00 KB
lrw-r--r--
2025-03-28 11:04:37
Edit
Download
Rename
Chmod
Change Date
Delete
OK
Cancel
recursive
OK
Cancel
recursive
OK
Cancel
index.ts
522 B
lrw-r--r--
2025-03-28 11:04:37
Edit
Download
Rename
Chmod
Change Date
Delete
OK
Cancel
recursive
OK
Cancel
recursive
OK
Cancel
mapping-entry.ts
1.95 KB
lrw-r--r--
2025-03-28 11:04:37
Edit
Download
Rename
Chmod
Change Date
Delete
OK
Cancel
recursive
OK
Cancel
recursive
OK
Cancel
match-path-async.ts
5.62 KB
lrw-r--r--
2025-03-28 11:04:37
Edit
Download
Rename
Chmod
Change Date
Delete
OK
Cancel
recursive
OK
Cancel
recursive
OK
Cancel
match-path-sync.ts
4.29 KB
lrw-r--r--
2025-03-28 11:04:37
Edit
Download
Rename
Chmod
Change Date
Delete
OK
Cancel
recursive
OK
Cancel
recursive
OK
Cancel
options.ts
304 B
lrw-r--r--
2025-03-28 11:04:37
Edit
Download
Rename
Chmod
Change Date
Delete
OK
Cancel
recursive
OK
Cancel
recursive
OK
Cancel
register.ts
2.48 KB
lrw-r--r--
2025-03-28 11:04:37
Edit
Download
Rename
Chmod
Change Date
Delete
OK
Cancel
recursive
OK
Cancel
recursive
OK
Cancel
try-path.ts
3.20 KB
lrw-r--r--
2025-03-28 11:04:37
Edit
Download
Rename
Chmod
Change Date
Delete
OK
Cancel
recursive
OK
Cancel
recursive
OK
Cancel
tsconfig-loader.ts
5.67 KB
lrw-r--r--
2025-03-28 11:04:37
Edit
Download
Rename
Chmod
Change Date
Delete
OK
Cancel
recursive
OK
Cancel
recursive
OK
Cancel
Zip Selected
If ZipArchive is unavailable, a
.tar
will be created (no compression).