@optique/core 1.0.0-dev.513 → 1.0.0-dev.515
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.d.cts +22 -2
- package/dist/constructs.d.ts +22 -2
- package/package.json +1 -1
package/dist/constructs.d.cts
CHANGED
|
@@ -1164,8 +1164,28 @@ type ConcatValues<TParsers extends ConcatParsers> = IsTuple<TParsers> extends tr
|
|
|
1164
1164
|
*
|
|
1165
1165
|
* @example
|
|
1166
1166
|
* ```typescript
|
|
1167
|
-
*
|
|
1168
|
-
*
|
|
1167
|
+
* import { parse } from "@optique/core/parser";
|
|
1168
|
+
* import { option } from "@optique/core/primitives";
|
|
1169
|
+
* import { integer, string } from "@optique/core/valueparser";
|
|
1170
|
+
*
|
|
1171
|
+
* const basicTuple = tuple([
|
|
1172
|
+
* option("-v", "--verbose"),
|
|
1173
|
+
* option("-p", "--port", integer()),
|
|
1174
|
+
* ]);
|
|
1175
|
+
*
|
|
1176
|
+
* const serverTuple = tuple([
|
|
1177
|
+
* option("-h", "--host", string()),
|
|
1178
|
+
* option("-d", "--debug"),
|
|
1179
|
+
* ]);
|
|
1180
|
+
*
|
|
1181
|
+
* const combined = concat(basicTuple, serverTuple);
|
|
1182
|
+
* // Inferred type: Parser<..., [boolean, number, string, boolean], ...>
|
|
1183
|
+
*
|
|
1184
|
+
* const result = parse(
|
|
1185
|
+
* combined,
|
|
1186
|
+
* ["-v", "-p", "8080", "-h", "localhost", "-d"],
|
|
1187
|
+
* );
|
|
1188
|
+
* // result.value: [true, 8080, "localhost", true]
|
|
1169
1189
|
* ```
|
|
1170
1190
|
*
|
|
1171
1191
|
* @param parsers Tuple parsers to concatenate.
|
package/dist/constructs.d.ts
CHANGED
|
@@ -1164,8 +1164,28 @@ type ConcatValues<TParsers extends ConcatParsers> = IsTuple<TParsers> extends tr
|
|
|
1164
1164
|
*
|
|
1165
1165
|
* @example
|
|
1166
1166
|
* ```typescript
|
|
1167
|
-
*
|
|
1168
|
-
*
|
|
1167
|
+
* import { parse } from "@optique/core/parser";
|
|
1168
|
+
* import { option } from "@optique/core/primitives";
|
|
1169
|
+
* import { integer, string } from "@optique/core/valueparser";
|
|
1170
|
+
*
|
|
1171
|
+
* const basicTuple = tuple([
|
|
1172
|
+
* option("-v", "--verbose"),
|
|
1173
|
+
* option("-p", "--port", integer()),
|
|
1174
|
+
* ]);
|
|
1175
|
+
*
|
|
1176
|
+
* const serverTuple = tuple([
|
|
1177
|
+
* option("-h", "--host", string()),
|
|
1178
|
+
* option("-d", "--debug"),
|
|
1179
|
+
* ]);
|
|
1180
|
+
*
|
|
1181
|
+
* const combined = concat(basicTuple, serverTuple);
|
|
1182
|
+
* // Inferred type: Parser<..., [boolean, number, string, boolean], ...>
|
|
1183
|
+
*
|
|
1184
|
+
* const result = parse(
|
|
1185
|
+
* combined,
|
|
1186
|
+
* ["-v", "-p", "8080", "-h", "localhost", "-d"],
|
|
1187
|
+
* );
|
|
1188
|
+
* // result.value: [true, 8080, "localhost", true]
|
|
1169
1189
|
* ```
|
|
1170
1190
|
*
|
|
1171
1191
|
* @param parsers Tuple parsers to concatenate.
|