@optique/core 1.2.0-dev.2320 → 1.2.0-dev.2322

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.
@@ -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;
@@ -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.2320",
3
+ "version": "1.2.0-dev.2322",
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.2320+6a72f083"
228
+ "@optique/env": "1.2.0-dev.2322+fa56f91e"
229
229
  },
230
230
  "scripts": {
231
231
  "build": "tsdown",