@optique/core 1.2.0-dev.2320 → 1.2.0-dev.2324
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/valueparser.cjs +4 -2
- package/dist/valueparser.js +5 -3
- package/package.json +2 -2
package/dist/valueparser.cjs
CHANGED
|
@@ -393,10 +393,12 @@ function transform(parser, mapping) {
|
|
|
393
393
|
value
|
|
394
394
|
};
|
|
395
395
|
}
|
|
396
|
+
if (typeof formatted !== "string") return transformMappingFailure();
|
|
396
397
|
let result;
|
|
397
398
|
try {
|
|
398
|
-
result = syncParser.parse(formatted);
|
|
399
|
-
} catch {
|
|
399
|
+
result = require_mode_dispatch.wrapForMode("sync", syncParser.parse(formatted));
|
|
400
|
+
} catch (error) {
|
|
401
|
+
if (error instanceof TypeError && error.message.includes("Promise")) throw error;
|
|
400
402
|
return transformMappingFailure();
|
|
401
403
|
}
|
|
402
404
|
if (!result.success) return result;
|
package/dist/valueparser.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { cloneMessage, lineBreak, message, metavar, text, valueSet } from "./message.js";
|
|
2
|
-
import { mapMaybePromiseByMode, wrapIterableForMode } from "./internal/mode-dispatch.js";
|
|
2
|
+
import { mapMaybePromiseByMode, wrapForMode, wrapIterableForMode } from "./internal/mode-dispatch.js";
|
|
3
3
|
import { defaultValues, dependencyId, dependencyIds, derivedValueParserMarker, getSnapshottedDefaultDependencyValues, isDependencySource, isDerivedValueParser, parseWithDependency, singleDefaultValue, snapshotDefaultDependencyValues, suggestWithDependency } from "./internal/dependency.js";
|
|
4
4
|
import { appendValueHint, appendValueSuggestions, deduplicateSuggestions } from "./suggestion.js";
|
|
5
5
|
import { ensureNonEmptyString, isNonEmptyString } from "./nonempty.js";
|
|
@@ -393,10 +393,12 @@ function transform(parser, mapping) {
|
|
|
393
393
|
value
|
|
394
394
|
};
|
|
395
395
|
}
|
|
396
|
+
if (typeof formatted !== "string") return transformMappingFailure();
|
|
396
397
|
let result;
|
|
397
398
|
try {
|
|
398
|
-
result = syncParser.parse(formatted);
|
|
399
|
-
} catch {
|
|
399
|
+
result = wrapForMode("sync", syncParser.parse(formatted));
|
|
400
|
+
} catch (error) {
|
|
401
|
+
if (error instanceof TypeError && error.message.includes("Promise")) throw error;
|
|
400
402
|
return transformMappingFailure();
|
|
401
403
|
}
|
|
402
404
|
if (!result.success) return result;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@optique/core",
|
|
3
|
-
"version": "1.2.0-dev.
|
|
3
|
+
"version": "1.2.0-dev.2324",
|
|
4
4
|
"description": "Type-safe combinatorial command-line interface parser",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"CLI",
|
|
@@ -225,7 +225,7 @@
|
|
|
225
225
|
"fast-check": "^4.7.0",
|
|
226
226
|
"tsdown": "^0.13.0",
|
|
227
227
|
"typescript": "^5.8.3",
|
|
228
|
-
"@optique/env": "1.2.0-dev.
|
|
228
|
+
"@optique/env": "1.2.0-dev.2324+747f36a7"
|
|
229
229
|
},
|
|
230
230
|
"scripts": {
|
|
231
231
|
"build": "tsdown",
|