@leeoohoo/ui-apps-devkit 0.1.3 → 0.1.4
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/bin/chatos-uiapp.js +1 -1
- package/package.json +1 -1
- package/src/lib/args.js +16 -2
package/bin/chatos-uiapp.js
CHANGED
package/package.json
CHANGED
package/src/lib/args.js
CHANGED
|
@@ -1,5 +1,20 @@
|
|
|
1
1
|
export function parseArgs(argv) {
|
|
2
|
-
const
|
|
2
|
+
const rawArgs = Array.isArray(argv) ? argv.slice() : [];
|
|
3
|
+
const head = rawArgs[0] || '';
|
|
4
|
+
const second = rawArgs[1] || '';
|
|
5
|
+
const hasRuntimePrefix =
|
|
6
|
+
head.endsWith('node') ||
|
|
7
|
+
head.endsWith('node.exe') ||
|
|
8
|
+
head.includes('/node') ||
|
|
9
|
+
head.includes('\\node') ||
|
|
10
|
+
head.endsWith('bun') ||
|
|
11
|
+
head.endsWith('bun.exe') ||
|
|
12
|
+
head.includes('/bun') ||
|
|
13
|
+
head.includes('\\bun') ||
|
|
14
|
+
second.endsWith('.js') ||
|
|
15
|
+
second.endsWith('.mjs') ||
|
|
16
|
+
second.endsWith('.cjs');
|
|
17
|
+
const raw = hasRuntimePrefix ? rawArgs.slice(2) : rawArgs;
|
|
3
18
|
const flags = {};
|
|
4
19
|
const positionals = [];
|
|
5
20
|
|
|
@@ -46,4 +61,3 @@ export function parseArgs(argv) {
|
|
|
46
61
|
|
|
47
62
|
return { positionals, flags };
|
|
48
63
|
}
|
|
49
|
-
|