@optique/core 1.0.0-dev.1536 → 1.0.0-dev.1547
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.cjs +53 -0
- package/dist/constructs.js +53 -0
- package/dist/facade.cjs +5 -3
- package/dist/facade.js +6 -4
- package/dist/index.cjs +0 -3
- package/dist/index.d.cts +2 -2
- package/dist/index.d.ts +2 -2
- package/dist/index.js +2 -2
- package/dist/modifiers.cjs +8 -0
- package/dist/modifiers.js +8 -0
- package/dist/parser.d.cts +38 -0
- package/dist/parser.d.ts +38 -0
- package/dist/primitives.cjs +19 -0
- package/dist/primitives.js +19 -0
- package/dist/usage.cjs +0 -194
- package/dist/usage.d.cts +1 -75
- package/dist/usage.d.ts +1 -75
- package/dist/usage.js +1 -192
- package/dist/validate.cjs +24 -13
- package/dist/validate.js +24 -13
- package/package.json +1 -1
package/dist/validate.cjs
CHANGED
|
@@ -112,19 +112,30 @@ function validateMetaNameCollisions(userNames, metaEntries) {
|
|
|
112
112
|
}
|
|
113
113
|
}
|
|
114
114
|
}
|
|
115
|
-
for (const [kind, label, names, prefixMatch] of metaEntries) {
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
if (
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
if (
|
|
123
|
-
if (
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
115
|
+
for (const [kind, label, names, prefixMatch] of metaEntries) for (const name of names) {
|
|
116
|
+
if (kind === "command") {
|
|
117
|
+
if (userNames.leadingNames.has(name)) if (userNames.allOptions.has(name)) throw new TypeError(`User-defined option "${name}" conflicts with the built-in ${label}.`);
|
|
118
|
+
else if (userNames.allCommands.has(name)) throw new TypeError(`User-defined command "${name}" conflicts with the built-in ${label}.`);
|
|
119
|
+
else if (userNames.allLiterals.has(name)) throw new TypeError(`Literal value "${name}" conflicts with the built-in ${label}.`);
|
|
120
|
+
else throw new TypeError(`User-defined name "${name}" conflicts with the built-in ${label}.`);
|
|
121
|
+
} else {
|
|
122
|
+
if (userNames.allOptions.has(name)) throw new TypeError(`User-defined option "${name}" conflicts with the built-in ${label}.`);
|
|
123
|
+
if (userNames.allCommands.has(name)) throw new TypeError(`User-defined command "${name}" conflicts with the built-in ${label}.`);
|
|
124
|
+
if (userNames.allLiterals.has(name)) throw new TypeError(`Literal value "${name}" conflicts with the built-in ${label}.`);
|
|
125
|
+
}
|
|
126
|
+
if (prefixMatch) {
|
|
127
|
+
const prefix = name + "=";
|
|
128
|
+
const checkSets = kind === "command" ? [userNames.leadingNames] : [
|
|
129
|
+
userNames.allOptions,
|
|
130
|
+
userNames.allCommands,
|
|
131
|
+
userNames.allLiterals
|
|
132
|
+
];
|
|
133
|
+
for (const nameSet of checkSets) for (const userName of nameSet) {
|
|
134
|
+
if (!userName.startsWith(prefix)) continue;
|
|
135
|
+
if (userNames.allOptions.has(userName)) throw new TypeError(`User-defined option "${userName}" conflicts with the built-in ${label} (prefix "${prefix}").`);
|
|
136
|
+
else if (userNames.allCommands.has(userName)) throw new TypeError(`User-defined command "${userName}" conflicts with the built-in ${label} (prefix "${prefix}").`);
|
|
137
|
+
else if (userNames.allLiterals.has(userName)) throw new TypeError(`Literal value "${userName}" conflicts with the built-in ${label} (prefix "${prefix}").`);
|
|
138
|
+
else throw new TypeError(`User-defined name "${userName}" conflicts with the built-in ${label} (prefix "${prefix}").`);
|
|
128
139
|
}
|
|
129
140
|
}
|
|
130
141
|
}
|
package/dist/validate.js
CHANGED
|
@@ -111,19 +111,30 @@ function validateMetaNameCollisions(userNames, metaEntries) {
|
|
|
111
111
|
}
|
|
112
112
|
}
|
|
113
113
|
}
|
|
114
|
-
for (const [kind, label, names, prefixMatch] of metaEntries) {
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
if (
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
if (
|
|
122
|
-
if (
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
114
|
+
for (const [kind, label, names, prefixMatch] of metaEntries) for (const name of names) {
|
|
115
|
+
if (kind === "command") {
|
|
116
|
+
if (userNames.leadingNames.has(name)) if (userNames.allOptions.has(name)) throw new TypeError(`User-defined option "${name}" conflicts with the built-in ${label}.`);
|
|
117
|
+
else if (userNames.allCommands.has(name)) throw new TypeError(`User-defined command "${name}" conflicts with the built-in ${label}.`);
|
|
118
|
+
else if (userNames.allLiterals.has(name)) throw new TypeError(`Literal value "${name}" conflicts with the built-in ${label}.`);
|
|
119
|
+
else throw new TypeError(`User-defined name "${name}" conflicts with the built-in ${label}.`);
|
|
120
|
+
} else {
|
|
121
|
+
if (userNames.allOptions.has(name)) throw new TypeError(`User-defined option "${name}" conflicts with the built-in ${label}.`);
|
|
122
|
+
if (userNames.allCommands.has(name)) throw new TypeError(`User-defined command "${name}" conflicts with the built-in ${label}.`);
|
|
123
|
+
if (userNames.allLiterals.has(name)) throw new TypeError(`Literal value "${name}" conflicts with the built-in ${label}.`);
|
|
124
|
+
}
|
|
125
|
+
if (prefixMatch) {
|
|
126
|
+
const prefix = name + "=";
|
|
127
|
+
const checkSets = kind === "command" ? [userNames.leadingNames] : [
|
|
128
|
+
userNames.allOptions,
|
|
129
|
+
userNames.allCommands,
|
|
130
|
+
userNames.allLiterals
|
|
131
|
+
];
|
|
132
|
+
for (const nameSet of checkSets) for (const userName of nameSet) {
|
|
133
|
+
if (!userName.startsWith(prefix)) continue;
|
|
134
|
+
if (userNames.allOptions.has(userName)) throw new TypeError(`User-defined option "${userName}" conflicts with the built-in ${label} (prefix "${prefix}").`);
|
|
135
|
+
else if (userNames.allCommands.has(userName)) throw new TypeError(`User-defined command "${userName}" conflicts with the built-in ${label} (prefix "${prefix}").`);
|
|
136
|
+
else if (userNames.allLiterals.has(userName)) throw new TypeError(`Literal value "${userName}" conflicts with the built-in ${label} (prefix "${prefix}").`);
|
|
137
|
+
else throw new TypeError(`User-defined name "${userName}" conflicts with the built-in ${label} (prefix "${prefix}").`);
|
|
127
138
|
}
|
|
128
139
|
}
|
|
129
140
|
}
|