@optique/core 1.0.0-dev.1737 → 1.0.0-dev.1741

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.
@@ -94,12 +94,7 @@ function isPromiseLike(value) {
94
94
  */
95
95
  function deriveOptionalInnerParseState(outerState, parser) {
96
96
  if (Array.isArray(outerState)) return outerState[0];
97
- const initial = parser.initialState;
98
- if (outerState != null && typeof outerState === "object") {
99
- const annotations = require_annotations.getAnnotations(outerState);
100
- if (annotations != null) return require_annotations.injectAnnotations(initial, annotations);
101
- }
102
- return initial;
97
+ return require_annotations.inheritAnnotations(outerState, parser.initialState);
103
98
  }
104
99
  /**
105
100
  * Internal helper for optional-style parsing logic shared by optional()
package/dist/modifiers.js CHANGED
@@ -1,4 +1,4 @@
1
- import { annotateFreshArray, annotationKey, getAnnotations, inheritAnnotations, injectAnnotations, isInjectedAnnotationWrapper, unwrapInjectedAnnotationWrapper } from "./annotations.js";
1
+ import { annotateFreshArray, annotationKey, getAnnotations, inheritAnnotations, isInjectedAnnotationWrapper, unwrapInjectedAnnotationWrapper } from "./annotations.js";
2
2
  import { formatMessage, message, text } from "./message.js";
3
3
  import { dispatchByMode, dispatchIterableByMode, mapModeValue } from "./mode-dispatch.js";
4
4
  import { composeDependencyMetadata } from "./dependency-metadata.js";
@@ -94,12 +94,7 @@ function isPromiseLike(value) {
94
94
  */
95
95
  function deriveOptionalInnerParseState(outerState, parser) {
96
96
  if (Array.isArray(outerState)) return outerState[0];
97
- const initial = parser.initialState;
98
- if (outerState != null && typeof outerState === "object") {
99
- const annotations = getAnnotations(outerState);
100
- if (annotations != null) return injectAnnotations(initial, annotations);
101
- }
102
- return initial;
97
+ return inheritAnnotations(outerState, parser.initialState);
103
98
  }
104
99
  /**
105
100
  * Internal helper for optional-style parsing logic shared by optional()
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@optique/core",
3
- "version": "1.0.0-dev.1737+f1436575",
3
+ "version": "1.0.0-dev.1741+8b06f17a",
4
4
  "description": "Type-safe combinatorial command-line interface parser",
5
5
  "keywords": [
6
6
  "CLI",