REDROOM
PHP 8.2.30
Path:
Logout
Edit File
Size: 1.42 KB
Close
//proc/thread-self/root/home/byroehnu/.trash/node_modules11/adminjs/src/utils/file-resolver.ts
Text
Base64
import path from 'path' /** * resolve relative file path to absolute file path. * @param filePath relative file path * @param syntax syntax that match the stack */ export const relativeFilePathResolver = (filePath: string, syntax: RegExp): string => { const stack = (new Error().stack || '').split('\n') const target = stack.findIndex((s) => syntax.test(s)) // Node = 8 shows stack like that: '(/path/to/file.ts:77:27) const pathNode8 = stack[target + 1].match(/\((.*):[0-9]+:[0-9]+\)/) // Node >= 10 shows stack like that: 'at /path/to/file.ts:77:27 const pathNode10 = stack[target + 1].match(/at (.*):[0-9]+:[0-9]+/) if (!pathNode8 && !pathNode10) { throw new Error('STACK does not have a file url. Check out if the node version >= 8') } const executionPath = (pathNode8 && pathNode8[1]) || (pathNode10 && pathNode10[1]) /** * decodeURIComponent used to decode parts of a path. * * Before: \D:\%D0%9D%D0%B8%D0%BA%D0%B8%D1%82%D0%B0\project\dist\components\photo * After: \D:\Никита\project\dist\components\photo */ const resultPath = decodeURIComponent(path.join(path.dirname(executionPath as string), filePath).replace(/^file:/gi, '')) /** * If the separator is a backslash, remove the first one. * If you do not do this, the file will not be found * * Required for Windows */ if (path.sep === '\\' && resultPath[0] === '\\') { return resultPath.slice(1) } return resultPath }
Save
Close
Exit & Reset
Text mode: syntax highlighting auto-detects file type.
Directory Contents
Dirs: 2 × Files: 5
Delete Selected
Select All
Select None
Sort:
Name
Size
Modified
Enable drag-to-move
Name
Size
Perms
Modified
Actions
flat
DIR
-
drwxr-xr-x
2026-02-28 00:32:44
Edit
Download
Rename
Chmod
Change Date
Delete
OK
Cancel
recursive
OK
Cancel
recursive
OK
Cancel
param-converter
DIR
-
drwxr-xr-x
2026-02-28 00:32:46
Edit
Download
Rename
Chmod
Change Date
Delete
OK
Cancel
recursive
OK
Cancel
recursive
OK
Cancel
error-type.enum.ts
322 B
lrw-r--r--
2026-02-28 00:32:10
Edit
Download
Rename
Chmod
Change Date
Delete
OK
Cancel
recursive
OK
Cancel
recursive
OK
Cancel
file-resolver.ts
1.42 KB
lrw-r--r--
2026-02-28 00:32:10
Edit
Download
Rename
Chmod
Change Date
Delete
OK
Cancel
recursive
OK
Cancel
recursive
OK
Cancel
index.ts
161 B
lrw-r--r--
2026-02-28 00:32:28
Edit
Download
Rename
Chmod
Change Date
Delete
OK
Cancel
recursive
OK
Cancel
recursive
OK
Cancel
theme-bundler.ts
438 B
lrw-r--r--
2026-02-28 00:32:46
Edit
Download
Rename
Chmod
Change Date
Delete
OK
Cancel
recursive
OK
Cancel
recursive
OK
Cancel
translate-functions.factory.ts
7.19 KB
lrw-r--r--
2026-02-28 00:32:46
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).