@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.
@@ -1164,8 +1164,28 @@ type ConcatValues<TParsers extends ConcatParsers> = IsTuple<TParsers> extends tr
1164
1164
  *
1165
1165
  * @example
1166
1166
  * ```typescript
1167
- * const parser = concat(tuple([string()]), tuple([number()]));
1168
- * // parser value: [string, number]
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.
@@ -1164,8 +1164,28 @@ type ConcatValues<TParsers extends ConcatParsers> = IsTuple<TParsers> extends tr
1164
1164
  *
1165
1165
  * @example
1166
1166
  * ```typescript
1167
- * const parser = concat(tuple([string()]), tuple([number()]));
1168
- * // parser value: [string, number]
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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@optique/core",
3
- "version": "1.0.0-dev.513+486612c6",
3
+ "version": "1.0.0-dev.515+abdd200c",
4
4
  "description": "Type-safe combinatorial command-line interface parser",
5
5
  "keywords": [
6
6
  "CLI",