@optique/run 0.9.0-dev.184 → 0.9.0-dev.186
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/valueparser.cjs +2 -0
- package/dist/valueparser.d.cts +2 -1
- package/dist/valueparser.d.ts +2 -1
- package/dist/valueparser.js +2 -0
- package/package.json +2 -2
package/dist/valueparser.cjs
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
const require_rolldown_runtime = require('./_virtual/rolldown_runtime.cjs');
|
|
2
2
|
const node_path = require_rolldown_runtime.__toESM(require("node:path"));
|
|
3
3
|
const __optique_core_message = require_rolldown_runtime.__toESM(require("@optique/core/message"));
|
|
4
|
+
const __optique_core_nonempty = require_rolldown_runtime.__toESM(require("@optique/core/nonempty"));
|
|
4
5
|
const node_fs = require_rolldown_runtime.__toESM(require("node:fs"));
|
|
5
6
|
|
|
6
7
|
//#region src/valueparser.ts
|
|
@@ -41,6 +42,7 @@ const node_fs = require_rolldown_runtime.__toESM(require("node:fs"));
|
|
|
41
42
|
*/
|
|
42
43
|
function path(options = {}) {
|
|
43
44
|
const { metavar = "PATH", type = "either", allowCreate = false, extensions } = options;
|
|
45
|
+
(0, __optique_core_nonempty.ensureNonEmptyString)(metavar);
|
|
44
46
|
const mustExist = "mustExist" in options ? options.mustExist : false;
|
|
45
47
|
const mustNotExist = "mustNotExist" in options ? options.mustNotExist : false;
|
|
46
48
|
return {
|
package/dist/valueparser.d.cts
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { Message } from "@optique/core/message";
|
|
2
|
+
import { NonEmptyString } from "@optique/core/nonempty";
|
|
2
3
|
import { ValueParser } from "@optique/core/valueparser";
|
|
3
4
|
|
|
4
5
|
//#region src/valueparser.d.ts
|
|
@@ -56,7 +57,7 @@ interface PathOptionsBase {
|
|
|
56
57
|
* The metavariable name for this parser, e.g., `"FILE"`, `"DIR"`.
|
|
57
58
|
* @default "PATH"
|
|
58
59
|
*/
|
|
59
|
-
readonly metavar?:
|
|
60
|
+
readonly metavar?: NonEmptyString;
|
|
60
61
|
/**
|
|
61
62
|
* Expected type of path (file, directory, or either).
|
|
62
63
|
* Only checked when {@link PathOptionsMustExist.mustExist} is `true`.
|
package/dist/valueparser.d.ts
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { Message } from "@optique/core/message";
|
|
2
|
+
import { NonEmptyString } from "@optique/core/nonempty";
|
|
2
3
|
import { ValueParser } from "@optique/core/valueparser";
|
|
3
4
|
|
|
4
5
|
//#region src/valueparser.d.ts
|
|
@@ -56,7 +57,7 @@ interface PathOptionsBase {
|
|
|
56
57
|
* The metavariable name for this parser, e.g., `"FILE"`, `"DIR"`.
|
|
57
58
|
* @default "PATH"
|
|
58
59
|
*/
|
|
59
|
-
readonly metavar?:
|
|
60
|
+
readonly metavar?: NonEmptyString;
|
|
60
61
|
/**
|
|
61
62
|
* Expected type of path (file, directory, or either).
|
|
62
63
|
* Only checked when {@link PathOptionsMustExist.mustExist} is `true`.
|
package/dist/valueparser.js
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { dirname, extname } from "node:path";
|
|
2
2
|
import { message, text } from "@optique/core/message";
|
|
3
|
+
import { ensureNonEmptyString } from "@optique/core/nonempty";
|
|
3
4
|
import { existsSync, statSync } from "node:fs";
|
|
4
5
|
|
|
5
6
|
//#region src/valueparser.ts
|
|
@@ -40,6 +41,7 @@ import { existsSync, statSync } from "node:fs";
|
|
|
40
41
|
*/
|
|
41
42
|
function path(options = {}) {
|
|
42
43
|
const { metavar = "PATH", type = "either", allowCreate = false, extensions } = options;
|
|
44
|
+
ensureNonEmptyString(metavar);
|
|
43
45
|
const mustExist = "mustExist" in options ? options.mustExist : false;
|
|
44
46
|
const mustNotExist = "mustNotExist" in options ? options.mustNotExist : false;
|
|
45
47
|
return {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@optique/run",
|
|
3
|
-
"version": "0.9.0-dev.
|
|
3
|
+
"version": "0.9.0-dev.186+976c1c1f",
|
|
4
4
|
"description": "Type-safe combinatorial command-line interface parser",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"CLI",
|
|
@@ -70,7 +70,7 @@
|
|
|
70
70
|
},
|
|
71
71
|
"sideEffects": false,
|
|
72
72
|
"dependencies": {
|
|
73
|
-
"@optique/core": "0.9.0-dev.
|
|
73
|
+
"@optique/core": "0.9.0-dev.186+976c1c1f"
|
|
74
74
|
},
|
|
75
75
|
"devDependencies": {
|
|
76
76
|
"@types/node": "^20.19.9",
|