@optique/core 0.7.0 → 0.7.1

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.
@@ -35,6 +35,11 @@ function optional(parser) {
35
35
  },
36
36
  consumed: result.consumed
37
37
  };
38
+ if (result.consumed === 0) return {
39
+ success: true,
40
+ next: context,
41
+ consumed: []
42
+ };
38
43
  return result;
39
44
  },
40
45
  complete(state) {
@@ -117,6 +122,11 @@ function withDefault(parser, defaultValue, options) {
117
122
  },
118
123
  consumed: result.consumed
119
124
  };
125
+ if (result.consumed === 0) return {
126
+ success: true,
127
+ next: context,
128
+ consumed: []
129
+ };
120
130
  return result;
121
131
  },
122
132
  complete(state) {
package/dist/modifiers.js CHANGED
@@ -35,6 +35,11 @@ function optional(parser) {
35
35
  },
36
36
  consumed: result.consumed
37
37
  };
38
+ if (result.consumed === 0) return {
39
+ success: true,
40
+ next: context,
41
+ consumed: []
42
+ };
38
43
  return result;
39
44
  },
40
45
  complete(state) {
@@ -117,6 +122,11 @@ function withDefault(parser, defaultValue, options) {
117
122
  },
118
123
  consumed: result.consumed
119
124
  };
125
+ if (result.consumed === 0) return {
126
+ success: true,
127
+ next: context,
128
+ consumed: []
129
+ };
120
130
  return result;
121
131
  },
122
132
  complete(state) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@optique/core",
3
- "version": "0.7.0",
3
+ "version": "0.7.1",
4
4
  "description": "Type-safe combinatorial command-line interface parser",
5
5
  "keywords": [
6
6
  "CLI",