@optique/core 0.9.0-dev.187 → 0.9.0-dev.191
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/constructs.cjs +5 -2
- package/dist/constructs.js +5 -2
- package/package.json +1 -1
package/dist/constructs.cjs
CHANGED
|
@@ -670,8 +670,11 @@ function merge(...args) {
|
|
|
670
670
|
for (let i = 0; i < parsers.length; i++) {
|
|
671
671
|
const parser = parsers[i];
|
|
672
672
|
let parserState;
|
|
673
|
-
if (parser.initialState === void 0)
|
|
674
|
-
|
|
673
|
+
if (parser.initialState === void 0) {
|
|
674
|
+
const key = `__parser_${i}`;
|
|
675
|
+
if (context.state && typeof context.state === "object" && key in context.state) parserState = context.state[key];
|
|
676
|
+
else parserState = void 0;
|
|
677
|
+
} else if (parser.initialState && typeof parser.initialState === "object") if (context.state && typeof context.state === "object") {
|
|
675
678
|
const extractedState = {};
|
|
676
679
|
for (const field in parser.initialState) extractedState[field] = field in context.state ? context.state[field] : parser.initialState[field];
|
|
677
680
|
parserState = extractedState;
|
package/dist/constructs.js
CHANGED
|
@@ -670,8 +670,11 @@ function merge(...args) {
|
|
|
670
670
|
for (let i = 0; i < parsers.length; i++) {
|
|
671
671
|
const parser = parsers[i];
|
|
672
672
|
let parserState;
|
|
673
|
-
if (parser.initialState === void 0)
|
|
674
|
-
|
|
673
|
+
if (parser.initialState === void 0) {
|
|
674
|
+
const key = `__parser_${i}`;
|
|
675
|
+
if (context.state && typeof context.state === "object" && key in context.state) parserState = context.state[key];
|
|
676
|
+
else parserState = void 0;
|
|
677
|
+
} else if (parser.initialState && typeof parser.initialState === "object") if (context.state && typeof context.state === "object") {
|
|
675
678
|
const extractedState = {};
|
|
676
679
|
for (const field in parser.initialState) extractedState[field] = field in context.state ? context.state[field] : parser.initialState[field];
|
|
677
680
|
parserState = extractedState;
|