typescript-virtual-container 1.5.5 → 1.5.7
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +117 -35
- package/dist/.tsbuildinfo +1 -1
- package/dist/SSHMimic/index.d.ts +5 -1
- package/dist/SSHMimic/index.js +27 -3
- package/dist/SSHMimic/scp.d.ts +34 -0
- package/dist/SSHMimic/scp.js +285 -0
- package/dist/SSHMimic/sftp.d.ts +53 -3
- package/dist/SSHMimic/sftp.js +9 -3
- package/dist/VirtualFileSystem/binaryPack.d.ts +7 -0
- package/dist/VirtualFileSystem/binaryPack.js +37 -1
- package/dist/VirtualFileSystem/index.d.ts +7 -0
- package/dist/VirtualFileSystem/index.js +67 -27
- package/dist/VirtualFileSystem/internalTypes.d.ts +2 -0
- package/dist/VirtualFileSystem/path.d.ts +5 -0
- package/dist/VirtualFileSystem/path.js +24 -11
- package/dist/VirtualPackageManager/index.d.ts +4 -2
- package/dist/VirtualPackageManager/index.js +24 -4
- package/dist/VirtualShell/index.d.ts +4 -0
- package/dist/VirtualShell/index.js +1 -7
- package/dist/VirtualShell/shell.js +40 -10
- package/dist/VirtualShell/shellParser.js +1 -22
- package/dist/commands/awk.d.ts +6 -11
- package/dist/commands/awk.js +462 -109
- package/dist/commands/bzip2.d.ts +11 -0
- package/dist/commands/bzip2.js +91 -0
- package/dist/commands/exit.js +1 -1
- package/dist/commands/find.d.ts +2 -2
- package/dist/commands/find.js +209 -37
- package/dist/commands/helpers.d.ts +0 -20
- package/dist/commands/helpers.js +0 -97
- package/dist/commands/lsof.d.ts +6 -0
- package/dist/commands/lsof.js +30 -0
- package/dist/commands/perl.d.ts +6 -0
- package/dist/commands/perl.js +76 -0
- package/dist/commands/python.js +5 -2
- package/dist/commands/registry.js +19 -1
- package/dist/commands/runtime.js +65 -87
- package/dist/commands/sed.d.ts +2 -2
- package/dist/commands/sed.js +216 -34
- package/dist/commands/sh.js +42 -0
- package/dist/commands/strace.d.ts +6 -0
- package/dist/commands/strace.js +26 -0
- package/dist/commands/tar.d.ts +2 -1
- package/dist/commands/tar.js +138 -52
- package/dist/commands/test.js +2 -2
- package/dist/commands/zip.d.ts +11 -0
- package/dist/commands/zip.js +232 -0
- package/dist/modules/linuxRootfs.js +1 -4
- package/dist/modules/neofetch.js +2 -2
- package/dist/types/commands.d.ts +4 -0
- package/dist/utils/argv.d.ts +6 -0
- package/dist/utils/argv.js +32 -0
- package/dist/utils/expand.d.ts +5 -2
- package/dist/utils/expand.js +112 -45
- package/dist/utils/glob.d.ts +6 -0
- package/dist/utils/glob.js +34 -0
- package/dist/utils/tokenize.js +13 -13
- package/package.json +9 -7
- package/dist/self-standalone.d.ts +0 -1
- package/dist/self-standalone.js +0 -444
- package/dist/standalone-wo-sftp.d.ts +0 -1
- package/dist/standalone-wo-sftp.js +0 -30
- package/dist/standalone.d.ts +0 -1
- package/dist/standalone.js +0 -61
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { globToRegex } from "../utils/glob";
|
|
1
2
|
import { tokenizeCommand } from "../utils/tokenize";
|
|
2
3
|
// ── Public API ───────────────────────────────────────────────────────────────
|
|
3
4
|
/**
|
|
@@ -42,28 +43,6 @@ export function expandGlob(pattern, entries) {
|
|
|
42
43
|
const matches = entries.filter((e) => regex.test(e));
|
|
43
44
|
return matches.length > 0 ? matches.sort() : [pattern];
|
|
44
45
|
}
|
|
45
|
-
function globToRegex(pattern) {
|
|
46
|
-
let re = "^";
|
|
47
|
-
for (let i = 0; i < pattern.length; i++) {
|
|
48
|
-
const c = pattern[i];
|
|
49
|
-
if (c === "*")
|
|
50
|
-
re += ".*";
|
|
51
|
-
else if (c === "?")
|
|
52
|
-
re += ".";
|
|
53
|
-
else if (c === "[") {
|
|
54
|
-
const close = pattern.indexOf("]", i + 1);
|
|
55
|
-
if (close === -1)
|
|
56
|
-
re += "\\[";
|
|
57
|
-
else {
|
|
58
|
-
re += `[${pattern.slice(i + 1, close)}]`;
|
|
59
|
-
i = close;
|
|
60
|
-
}
|
|
61
|
-
}
|
|
62
|
-
else
|
|
63
|
-
re += c.replace(/[.+^${}()|[\]\\]/g, "\\$&");
|
|
64
|
-
}
|
|
65
|
-
return new RegExp(`${re}$`);
|
|
66
|
-
}
|
|
67
46
|
// ── Internal parser ───────────────────────────────────────────────────────────
|
|
68
47
|
function parseStatements(input) {
|
|
69
48
|
// Split by ;, &&, || — respecting quotes and parens
|
package/dist/commands/awk.d.ts
CHANGED
|
@@ -1,15 +1,10 @@
|
|
|
1
|
+
/** biome-ignore-all lint/style/useNamingConvention: AWK vars (NR, NF, FS, OFS, ORS) are spec names */
|
|
1
2
|
import type { ShellModule } from "../types/commands";
|
|
2
3
|
/**
|
|
3
|
-
*
|
|
4
|
-
*
|
|
5
|
-
*
|
|
6
|
-
*
|
|
7
|
-
*
|
|
8
|
-
* - `/regex/` pattern
|
|
9
|
-
* - `{ print $N, $M, ... }` action
|
|
10
|
-
* - `{ print }` / `{ print $0 }`
|
|
11
|
-
* - `BEGIN { ... }` and `END { ... }` blocks (no side effects)
|
|
12
|
-
* - `$NF` (last field)
|
|
13
|
-
* - `-F sep` field separator
|
|
4
|
+
* AWK pattern scanning — supports BEGIN/END, /regex/, NR/NF conditions, field ops,
|
|
5
|
+
* variable assignment (-v), arithmetic, string functions (sub/gsub/substr/split/length/index/sprintf/tolower/toupper/match),
|
|
6
|
+
* printf, getline (from stdin), next, and multi-statement blocks.
|
|
7
|
+
* @category text
|
|
8
|
+
* @params ["[-F sep] [-v var=val] '<program>' [file]"]
|
|
14
9
|
*/
|
|
15
10
|
export declare const awkCommand: ShellModule;
|