@optique/run 1.0.0-dev.771 → 1.0.0-dev.783
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 +3 -0
- package/dist/valueparser.d.cts +2 -0
- package/dist/valueparser.d.ts +2 -0
- package/dist/valueparser.js +3 -0
- package/package.json +2 -2
package/dist/valueparser.cjs
CHANGED
|
@@ -16,6 +16,8 @@ const node_fs = require_rolldown_runtime.__toESM(require("node:fs"));
|
|
|
16
16
|
* @returns A ValueParser that validates and returns string paths.
|
|
17
17
|
* @throws {TypeError} If any entry in {@link PathOptionsBase.extensions} does
|
|
18
18
|
* not start with a dot (e.g., `"json"` instead of `".json"`).
|
|
19
|
+
* @throws {TypeError} If both {@link PathOptionsMustExist.mustExist} and
|
|
20
|
+
* {@link PathOptionsMustNotExist.mustNotExist} are `true`.
|
|
19
21
|
*
|
|
20
22
|
* @example
|
|
21
23
|
* ```typescript
|
|
@@ -50,6 +52,7 @@ function path(options = {}) {
|
|
|
50
52
|
}
|
|
51
53
|
const mustExist = "mustExist" in options ? options.mustExist : false;
|
|
52
54
|
const mustNotExist = "mustNotExist" in options ? options.mustNotExist : false;
|
|
55
|
+
if (mustExist && mustNotExist) throw new TypeError("Options mustExist and mustNotExist are mutually exclusive.");
|
|
53
56
|
return {
|
|
54
57
|
$mode: "sync",
|
|
55
58
|
metavar,
|
package/dist/valueparser.d.cts
CHANGED
|
@@ -151,6 +151,8 @@ type PathOptions = PathOptionsMustExist | PathOptionsMustNotExist | PathOptionsN
|
|
|
151
151
|
* @returns A ValueParser that validates and returns string paths.
|
|
152
152
|
* @throws {TypeError} If any entry in {@link PathOptionsBase.extensions} does
|
|
153
153
|
* not start with a dot (e.g., `"json"` instead of `".json"`).
|
|
154
|
+
* @throws {TypeError} If both {@link PathOptionsMustExist.mustExist} and
|
|
155
|
+
* {@link PathOptionsMustNotExist.mustNotExist} are `true`.
|
|
154
156
|
*
|
|
155
157
|
* @example
|
|
156
158
|
* ```typescript
|
package/dist/valueparser.d.ts
CHANGED
|
@@ -151,6 +151,8 @@ type PathOptions = PathOptionsMustExist | PathOptionsMustNotExist | PathOptionsN
|
|
|
151
151
|
* @returns A ValueParser that validates and returns string paths.
|
|
152
152
|
* @throws {TypeError} If any entry in {@link PathOptionsBase.extensions} does
|
|
153
153
|
* not start with a dot (e.g., `"json"` instead of `".json"`).
|
|
154
|
+
* @throws {TypeError} If both {@link PathOptionsMustExist.mustExist} and
|
|
155
|
+
* {@link PathOptionsMustNotExist.mustNotExist} are `true`.
|
|
154
156
|
*
|
|
155
157
|
* @example
|
|
156
158
|
* ```typescript
|
package/dist/valueparser.js
CHANGED
|
@@ -15,6 +15,8 @@ import { existsSync, statSync } from "node:fs";
|
|
|
15
15
|
* @returns A ValueParser that validates and returns string paths.
|
|
16
16
|
* @throws {TypeError} If any entry in {@link PathOptionsBase.extensions} does
|
|
17
17
|
* not start with a dot (e.g., `"json"` instead of `".json"`).
|
|
18
|
+
* @throws {TypeError} If both {@link PathOptionsMustExist.mustExist} and
|
|
19
|
+
* {@link PathOptionsMustNotExist.mustNotExist} are `true`.
|
|
18
20
|
*
|
|
19
21
|
* @example
|
|
20
22
|
* ```typescript
|
|
@@ -49,6 +51,7 @@ function path(options = {}) {
|
|
|
49
51
|
}
|
|
50
52
|
const mustExist = "mustExist" in options ? options.mustExist : false;
|
|
51
53
|
const mustNotExist = "mustNotExist" in options ? options.mustNotExist : false;
|
|
54
|
+
if (mustExist && mustNotExist) throw new TypeError("Options mustExist and mustNotExist are mutually exclusive.");
|
|
52
55
|
return {
|
|
53
56
|
$mode: "sync",
|
|
54
57
|
metavar,
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@optique/run",
|
|
3
|
-
"version": "1.0.0-dev.
|
|
3
|
+
"version": "1.0.0-dev.783+64de3665",
|
|
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": "1.0.0-dev.
|
|
73
|
+
"@optique/core": "1.0.0-dev.783+64de3665"
|
|
74
74
|
},
|
|
75
75
|
"devDependencies": {
|
|
76
76
|
"@types/node": "^20.19.9",
|