@optique/core 0.6.6 → 0.6.7
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
|
@@ -550,8 +550,11 @@ function merge(...args) {
|
|
|
550
550
|
for (let i = 0; i < parsers.length; i++) {
|
|
551
551
|
const parser = parsers[i];
|
|
552
552
|
let parserState;
|
|
553
|
-
if (parser.initialState === void 0)
|
|
554
|
-
|
|
553
|
+
if (parser.initialState === void 0) {
|
|
554
|
+
const key = `__parser_${i}`;
|
|
555
|
+
if (context.state && typeof context.state === "object" && key in context.state) parserState = context.state[key];
|
|
556
|
+
else parserState = void 0;
|
|
557
|
+
} else if (parser.initialState && typeof parser.initialState === "object") if (context.state && typeof context.state === "object") {
|
|
555
558
|
const extractedState = {};
|
|
556
559
|
for (const field in parser.initialState) extractedState[field] = field in context.state ? context.state[field] : parser.initialState[field];
|
|
557
560
|
parserState = extractedState;
|
package/dist/constructs.js
CHANGED
|
@@ -550,8 +550,11 @@ function merge(...args) {
|
|
|
550
550
|
for (let i = 0; i < parsers.length; i++) {
|
|
551
551
|
const parser = parsers[i];
|
|
552
552
|
let parserState;
|
|
553
|
-
if (parser.initialState === void 0)
|
|
554
|
-
|
|
553
|
+
if (parser.initialState === void 0) {
|
|
554
|
+
const key = `__parser_${i}`;
|
|
555
|
+
if (context.state && typeof context.state === "object" && key in context.state) parserState = context.state[key];
|
|
556
|
+
else parserState = void 0;
|
|
557
|
+
} else if (parser.initialState && typeof parser.initialState === "object") if (context.state && typeof context.state === "object") {
|
|
555
558
|
const extractedState = {};
|
|
556
559
|
for (const field in parser.initialState) extractedState[field] = field in context.state ? context.state[field] : parser.initialState[field];
|
|
557
560
|
parserState = extractedState;
|