@deephaven-enterprise/query-utils 2026.1.39 → 2026.1.40
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/dist/ArgumentUtils.d.ts +13 -0
- package/dist/ArgumentUtils.js +17 -0
- package/dist/WorkerThreadUtils.js +5 -4
- package/dist/index.d.ts +1 -0
- package/dist/index.js +1 -0
- package/package.json +1 -1
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Tokenizes a string of arguments by whitespace, respecting quoted spans.
|
|
3
|
+
* Whitespace that appears inside `"..."` or `'...'` is treated as a literal
|
|
4
|
+
* character and does not cause a split. Quotes are preserved in the returned
|
|
5
|
+
* tokens so the operation is lossless.
|
|
6
|
+
*
|
|
7
|
+
* Unbalanced quotes are treated as literal characters and splitting proceeds
|
|
8
|
+
* normally.
|
|
9
|
+
*
|
|
10
|
+
* @param args The argument string to tokenize (e.g. JVM args or env vars).
|
|
11
|
+
* @returns An array of tokens. Returns an empty array for empty/whitespace input.
|
|
12
|
+
*/
|
|
13
|
+
export declare function tokenizeArgs(args: string): string[];
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Tokenizes a string of arguments by whitespace, respecting quoted spans.
|
|
3
|
+
* Whitespace that appears inside `"..."` or `'...'` is treated as a literal
|
|
4
|
+
* character and does not cause a split. Quotes are preserved in the returned
|
|
5
|
+
* tokens so the operation is lossless.
|
|
6
|
+
*
|
|
7
|
+
* Unbalanced quotes are treated as literal characters and splitting proceeds
|
|
8
|
+
* normally.
|
|
9
|
+
*
|
|
10
|
+
* @param args The argument string to tokenize (e.g. JVM args or env vars).
|
|
11
|
+
* @returns An array of tokens. Returns an empty array for empty/whitespace input.
|
|
12
|
+
*/
|
|
13
|
+
// eslint-disable-next-line import/prefer-default-export
|
|
14
|
+
export function tokenizeArgs(args) {
|
|
15
|
+
var _a;
|
|
16
|
+
return (_a = args.match(/(?:[^\s"']+|"[^"]*"|'[^']*'|["'])+/g)) !== null && _a !== void 0 ? _a : [];
|
|
17
|
+
}
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { tokenizeArgs } from './ArgumentUtils';
|
|
1
2
|
/**
|
|
2
3
|
* Utility class for managing worker thread configuration arguments.
|
|
3
4
|
*/
|
|
@@ -22,9 +23,9 @@ export class WorkerThreadUtils {
|
|
|
22
23
|
* @returns the display string or the system default string if not found
|
|
23
24
|
*/
|
|
24
25
|
static getDisplayStringFromJvmArgs(jvmArgs, argName) {
|
|
25
|
-
const args = jvmArgs
|
|
26
|
+
const args = tokenizeArgs(jvmArgs);
|
|
26
27
|
for (let i = 0; i < args.length; i += 1) {
|
|
27
|
-
if (args[i].
|
|
28
|
+
if (args[i].startsWith(`-D${argName}=`)) {
|
|
28
29
|
return WorkerThreadUtils.getDisplayString(args[i].split('=')[1]);
|
|
29
30
|
}
|
|
30
31
|
}
|
|
@@ -38,8 +39,8 @@ export class WorkerThreadUtils {
|
|
|
38
39
|
* @returns a new string with the thread count arguments removed
|
|
39
40
|
*/
|
|
40
41
|
static removeArgs(jvmArgs) {
|
|
41
|
-
const args = jvmArgs
|
|
42
|
-
const filteredArgs = args.filter(arg => !WorkerThreadUtils.ALL_ARGS.some(argName => arg.
|
|
42
|
+
const args = tokenizeArgs(jvmArgs);
|
|
43
|
+
const filteredArgs = args.filter(arg => !WorkerThreadUtils.ALL_ARGS.some(argName => arg.startsWith(`-D${argName}=`)));
|
|
43
44
|
return filteredArgs.join(' ');
|
|
44
45
|
}
|
|
45
46
|
/**
|
package/dist/index.d.ts
CHANGED
package/dist/index.js
CHANGED