@gunshi/combinators 0.29.2 → 0.29.4
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/lib/index.d.ts +2 -2
- package/lib/index.js +20 -3
- package/package.json +6 -6
package/lib/index.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
//#region ../../node_modules/.pnpm/args-tokens@0.24.
|
|
1
|
+
//#region ../../node_modules/.pnpm/args-tokens@0.24.3/node_modules/args-tokens/lib/resolver.d.ts
|
|
2
2
|
|
|
3
3
|
//#region src/resolver.d.ts
|
|
4
4
|
/**
|
|
@@ -439,7 +439,7 @@ interface Args {
|
|
|
439
439
|
* @typeParam T - {@link Args | Arguments} which is an object that defines the command line arguments.
|
|
440
440
|
*/
|
|
441
441
|
//#endregion
|
|
442
|
-
//#region ../../node_modules/.pnpm/args-tokens@0.24.
|
|
442
|
+
//#region ../../node_modules/.pnpm/args-tokens@0.24.3/node_modules/args-tokens/lib/combinators.d.ts
|
|
443
443
|
//#region src/combinators.d.ts
|
|
444
444
|
/**
|
|
445
445
|
* @author kazuya kawaguchi (a.k.a. kazupon)
|
package/lib/index.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
//#region ../../node_modules/.pnpm/args-tokens@0.24.
|
|
1
|
+
//#region ../../node_modules/.pnpm/args-tokens@0.24.3/node_modules/args-tokens/lib/combinators.js
|
|
2
2
|
/**
|
|
3
3
|
* Create a string argument schema with optional validation.
|
|
4
4
|
*
|
|
@@ -14,6 +14,7 @@
|
|
|
14
14
|
*
|
|
15
15
|
* @experimental
|
|
16
16
|
*/
|
|
17
|
+
/* @__NO_SIDE_EFFECTS__ */
|
|
17
18
|
function string(opts) {
|
|
18
19
|
return {
|
|
19
20
|
type: "string",
|
|
@@ -46,6 +47,7 @@ function string(opts) {
|
|
|
46
47
|
*
|
|
47
48
|
* @experimental
|
|
48
49
|
*/
|
|
50
|
+
/* @__NO_SIDE_EFFECTS__ */
|
|
49
51
|
function number(opts) {
|
|
50
52
|
return {
|
|
51
53
|
type: "number",
|
|
@@ -79,6 +81,7 @@ function number(opts) {
|
|
|
79
81
|
*
|
|
80
82
|
* @experimental
|
|
81
83
|
*/
|
|
84
|
+
/* @__NO_SIDE_EFFECTS__ */
|
|
82
85
|
function integer(opts) {
|
|
83
86
|
return {
|
|
84
87
|
type: "custom",
|
|
@@ -113,6 +116,7 @@ function integer(opts) {
|
|
|
113
116
|
*
|
|
114
117
|
* @experimental
|
|
115
118
|
*/
|
|
119
|
+
/* @__NO_SIDE_EFFECTS__ */
|
|
116
120
|
function float(opts) {
|
|
117
121
|
return {
|
|
118
122
|
type: "custom",
|
|
@@ -150,6 +154,7 @@ function float(opts) {
|
|
|
150
154
|
*
|
|
151
155
|
* @experimental
|
|
152
156
|
*/
|
|
157
|
+
/* @__NO_SIDE_EFFECTS__ */
|
|
153
158
|
function boolean(opts) {
|
|
154
159
|
return {
|
|
155
160
|
type: "boolean",
|
|
@@ -163,6 +168,7 @@ function boolean(opts) {
|
|
|
163
168
|
}
|
|
164
169
|
};
|
|
165
170
|
}
|
|
171
|
+
/* @__NO_SIDE_EFFECTS__ */
|
|
166
172
|
function positional(parser) {
|
|
167
173
|
if (parser && "parse" in parser) return {
|
|
168
174
|
type: "positional",
|
|
@@ -200,6 +206,7 @@ function positional(parser) {
|
|
|
200
206
|
*
|
|
201
207
|
* @experimental
|
|
202
208
|
*/
|
|
209
|
+
/* @__NO_SIDE_EFFECTS__ */
|
|
203
210
|
function choice(values, opts) {
|
|
204
211
|
return {
|
|
205
212
|
type: "enum",
|
|
@@ -244,6 +251,7 @@ function choice(values, opts) {
|
|
|
244
251
|
*
|
|
245
252
|
* @experimental
|
|
246
253
|
*/
|
|
254
|
+
/* @__NO_SIDE_EFFECTS__ */
|
|
247
255
|
function combinator(config) {
|
|
248
256
|
return {
|
|
249
257
|
type: "custom",
|
|
@@ -276,6 +284,7 @@ function combinator(config) {
|
|
|
276
284
|
*
|
|
277
285
|
* @experimental
|
|
278
286
|
*/
|
|
287
|
+
/* @__NO_SIDE_EFFECTS__ */
|
|
279
288
|
function map(schema, transform) {
|
|
280
289
|
const baseParse = schema.parse;
|
|
281
290
|
return {
|
|
@@ -305,6 +314,7 @@ function map(schema, transform) {
|
|
|
305
314
|
*
|
|
306
315
|
* @experimental
|
|
307
316
|
*/
|
|
317
|
+
/* @__NO_SIDE_EFFECTS__ */
|
|
308
318
|
function withDefault(schema, defaultValue) {
|
|
309
319
|
return {
|
|
310
320
|
...schema,
|
|
@@ -330,6 +340,7 @@ function withDefault(schema, defaultValue) {
|
|
|
330
340
|
*
|
|
331
341
|
* @experimental
|
|
332
342
|
*/
|
|
343
|
+
/* @__NO_SIDE_EFFECTS__ */
|
|
333
344
|
function multiple(schema) {
|
|
334
345
|
return {
|
|
335
346
|
...schema,
|
|
@@ -355,6 +366,7 @@ function multiple(schema) {
|
|
|
355
366
|
*
|
|
356
367
|
* @experimental
|
|
357
368
|
*/
|
|
369
|
+
/* @__NO_SIDE_EFFECTS__ */
|
|
358
370
|
function required(schema) {
|
|
359
371
|
return {
|
|
360
372
|
...schema,
|
|
@@ -383,6 +395,7 @@ function required(schema) {
|
|
|
383
395
|
*
|
|
384
396
|
* @experimental
|
|
385
397
|
*/
|
|
398
|
+
/* @__NO_SIDE_EFFECTS__ */
|
|
386
399
|
function short(schema, alias) {
|
|
387
400
|
return {
|
|
388
401
|
...schema,
|
|
@@ -410,6 +423,7 @@ function short(schema, alias) {
|
|
|
410
423
|
*
|
|
411
424
|
* @experimental
|
|
412
425
|
*/
|
|
426
|
+
/* @__NO_SIDE_EFFECTS__ */
|
|
413
427
|
function describe(schema, text) {
|
|
414
428
|
return {
|
|
415
429
|
...schema,
|
|
@@ -436,6 +450,7 @@ function describe(schema, text) {
|
|
|
436
450
|
*
|
|
437
451
|
* @experimental
|
|
438
452
|
*/
|
|
453
|
+
/* @__NO_SIDE_EFFECTS__ */
|
|
439
454
|
function unrequired(schema) {
|
|
440
455
|
return {
|
|
441
456
|
...schema,
|
|
@@ -463,9 +478,11 @@ function unrequired(schema) {
|
|
|
463
478
|
*
|
|
464
479
|
* @experimental
|
|
465
480
|
*/
|
|
481
|
+
/* @__NO_SIDE_EFFECTS__ */
|
|
466
482
|
function args(fields) {
|
|
467
483
|
return fields;
|
|
468
484
|
}
|
|
485
|
+
/* @__NO_SIDE_EFFECTS__ */
|
|
469
486
|
function merge(...schemas) {
|
|
470
487
|
const result = Object.create(null);
|
|
471
488
|
for (const schema of schemas) for (const key of Object.keys(schema)) result[key] = schema[key];
|
|
@@ -492,12 +509,12 @@ function merge(...schemas) {
|
|
|
492
509
|
*
|
|
493
510
|
* @experimental
|
|
494
511
|
*/
|
|
512
|
+
/* @__NO_SIDE_EFFECTS__ */
|
|
495
513
|
function extend(base, overrides) {
|
|
496
514
|
const result = Object.create(null);
|
|
497
515
|
for (const key of Object.keys(base)) result[key] = base[key];
|
|
498
516
|
for (const key of Object.keys(overrides)) result[key] = overrides[key];
|
|
499
517
|
return result;
|
|
500
518
|
}
|
|
501
|
-
|
|
502
519
|
//#endregion
|
|
503
|
-
export { args, boolean, choice, combinator, describe, extend, float, integer, map, merge, multiple, number, positional, required, short, string, unrequired, withDefault };
|
|
520
|
+
export { args, boolean, choice, combinator, describe, extend, float, integer, map, merge, multiple, number, positional, required, short, string, unrequired, withDefault };
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@gunshi/combinators",
|
|
3
3
|
"description": "parser combinators for gunshi argument schema",
|
|
4
|
-
"version": "0.29.
|
|
4
|
+
"version": "0.29.4",
|
|
5
5
|
"author": {
|
|
6
6
|
"name": "kazuya kawaguchi",
|
|
7
7
|
"email": "kawakazu80@gmail.com"
|
|
@@ -52,12 +52,12 @@
|
|
|
52
52
|
}
|
|
53
53
|
},
|
|
54
54
|
"devDependencies": {
|
|
55
|
-
"deno": "^2.
|
|
56
|
-
"jsr": "^0.
|
|
57
|
-
"jsr-exports-lint": "^0.4.
|
|
58
|
-
"publint": "^0.3.
|
|
55
|
+
"deno": "^2.7.11",
|
|
56
|
+
"jsr": "^0.14.3",
|
|
57
|
+
"jsr-exports-lint": "^0.4.2",
|
|
58
|
+
"publint": "^0.3.18",
|
|
59
59
|
"tsdown": "0.15.12",
|
|
60
|
-
"gunshi": "0.29.
|
|
60
|
+
"gunshi": "0.29.4"
|
|
61
61
|
},
|
|
62
62
|
"scripts": {
|
|
63
63
|
"build": "tsdown",
|