@optique/core 0.8.2 → 0.8.3

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.
@@ -669,8 +669,11 @@ function merge(...args) {
669
669
  for (let i = 0; i < parsers.length; i++) {
670
670
  const parser = parsers[i];
671
671
  let parserState;
672
- if (parser.initialState === void 0) parserState = void 0;
673
- else if (parser.initialState && typeof parser.initialState === "object") if (context.state && typeof context.state === "object") {
672
+ if (parser.initialState === void 0) {
673
+ const key = `__parser_${i}`;
674
+ if (context.state && typeof context.state === "object" && key in context.state) parserState = context.state[key];
675
+ else parserState = void 0;
676
+ } else if (parser.initialState && typeof parser.initialState === "object") if (context.state && typeof context.state === "object") {
674
677
  const extractedState = {};
675
678
  for (const field in parser.initialState) extractedState[field] = field in context.state ? context.state[field] : parser.initialState[field];
676
679
  parserState = extractedState;
@@ -669,8 +669,11 @@ function merge(...args) {
669
669
  for (let i = 0; i < parsers.length; i++) {
670
670
  const parser = parsers[i];
671
671
  let parserState;
672
- if (parser.initialState === void 0) parserState = void 0;
673
- else if (parser.initialState && typeof parser.initialState === "object") if (context.state && typeof context.state === "object") {
672
+ if (parser.initialState === void 0) {
673
+ const key = `__parser_${i}`;
674
+ if (context.state && typeof context.state === "object" && key in context.state) parserState = context.state[key];
675
+ else parserState = void 0;
676
+ } else if (parser.initialState && typeof parser.initialState === "object") if (context.state && typeof context.state === "object") {
674
677
  const extractedState = {};
675
678
  for (const field in parser.initialState) extractedState[field] = field in context.state ? context.state[field] : parser.initialState[field];
676
679
  parserState = extractedState;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@optique/core",
3
- "version": "0.8.2",
3
+ "version": "0.8.3",
4
4
  "description": "Type-safe combinatorial command-line interface parser",
5
5
  "keywords": [
6
6
  "CLI",