@optique/core 1.0.0-dev.1745 → 1.0.0-dev.1749
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/modifiers.cjs +8 -2
- package/dist/modifiers.js +8 -2
- package/package.json +1 -1
package/dist/modifiers.cjs
CHANGED
|
@@ -93,8 +93,14 @@ function isPromiseLike(value) {
|
|
|
93
93
|
* @internal
|
|
94
94
|
*/
|
|
95
95
|
function deriveOptionalInnerParseState(outerState, parser) {
|
|
96
|
-
if (Array.isArray(outerState))
|
|
97
|
-
|
|
96
|
+
if (Array.isArray(outerState)) {
|
|
97
|
+
const innerState = outerState[0];
|
|
98
|
+
if (require_annotations.getAnnotations(outerState) != null && innerState != null && typeof innerState === "object") return require_annotations.inheritAnnotations(outerState, innerState);
|
|
99
|
+
return innerState;
|
|
100
|
+
}
|
|
101
|
+
const initial = parser.initialState;
|
|
102
|
+
if (initial != null && typeof initial !== "object") return initial;
|
|
103
|
+
return require_annotations.inheritAnnotations(outerState, initial);
|
|
98
104
|
}
|
|
99
105
|
/**
|
|
100
106
|
* Internal helper for optional-style parsing logic shared by optional()
|
package/dist/modifiers.js
CHANGED
|
@@ -93,8 +93,14 @@ function isPromiseLike(value) {
|
|
|
93
93
|
* @internal
|
|
94
94
|
*/
|
|
95
95
|
function deriveOptionalInnerParseState(outerState, parser) {
|
|
96
|
-
if (Array.isArray(outerState))
|
|
97
|
-
|
|
96
|
+
if (Array.isArray(outerState)) {
|
|
97
|
+
const innerState = outerState[0];
|
|
98
|
+
if (getAnnotations(outerState) != null && innerState != null && typeof innerState === "object") return inheritAnnotations(outerState, innerState);
|
|
99
|
+
return innerState;
|
|
100
|
+
}
|
|
101
|
+
const initial = parser.initialState;
|
|
102
|
+
if (initial != null && typeof initial !== "object") return initial;
|
|
103
|
+
return inheritAnnotations(outerState, initial);
|
|
98
104
|
}
|
|
99
105
|
/**
|
|
100
106
|
* Internal helper for optional-style parsing logic shared by optional()
|