@optique/core 1.0.0-dev.1169 → 1.0.0-dev.1172
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 +9 -1
- package/dist/valueparser.js +9 -1
- package/package.json +1 -1
package/dist/valueparser.cjs
CHANGED
|
@@ -1170,7 +1170,7 @@ function hostname(options) {
|
|
|
1170
1170
|
error: msg
|
|
1171
1171
|
};
|
|
1172
1172
|
}
|
|
1173
|
-
if (!allowLocalhost && input === "localhost") {
|
|
1173
|
+
if (!allowLocalhost && input.toLowerCase() === "localhost") {
|
|
1174
1174
|
const errorMsg = options?.errors?.localhostNotAllowed;
|
|
1175
1175
|
const msg = typeof errorMsg === "function" ? errorMsg(input) : errorMsg ?? require_message.message`Hostname 'localhost' is not allowed.`;
|
|
1176
1176
|
return {
|
|
@@ -1196,6 +1196,14 @@ function hostname(options) {
|
|
|
1196
1196
|
error: msg
|
|
1197
1197
|
};
|
|
1198
1198
|
}
|
|
1199
|
+
if (!allowLocalhost && rest.toLowerCase() === "localhost") {
|
|
1200
|
+
const errorMsg = options?.errors?.localhostNotAllowed;
|
|
1201
|
+
const msg = typeof errorMsg === "function" ? errorMsg(input) : errorMsg ?? require_message.message`Hostname 'localhost' is not allowed.`;
|
|
1202
|
+
return {
|
|
1203
|
+
success: false,
|
|
1204
|
+
error: msg
|
|
1205
|
+
};
|
|
1206
|
+
}
|
|
1199
1207
|
}
|
|
1200
1208
|
if (!allowUnderscore && input.includes("_")) {
|
|
1201
1209
|
const errorMsg = options?.errors?.underscoreNotAllowed;
|
package/dist/valueparser.js
CHANGED
|
@@ -1170,7 +1170,7 @@ function hostname(options) {
|
|
|
1170
1170
|
error: msg
|
|
1171
1171
|
};
|
|
1172
1172
|
}
|
|
1173
|
-
if (!allowLocalhost && input === "localhost") {
|
|
1173
|
+
if (!allowLocalhost && input.toLowerCase() === "localhost") {
|
|
1174
1174
|
const errorMsg = options?.errors?.localhostNotAllowed;
|
|
1175
1175
|
const msg = typeof errorMsg === "function" ? errorMsg(input) : errorMsg ?? message`Hostname 'localhost' is not allowed.`;
|
|
1176
1176
|
return {
|
|
@@ -1196,6 +1196,14 @@ function hostname(options) {
|
|
|
1196
1196
|
error: msg
|
|
1197
1197
|
};
|
|
1198
1198
|
}
|
|
1199
|
+
if (!allowLocalhost && rest.toLowerCase() === "localhost") {
|
|
1200
|
+
const errorMsg = options?.errors?.localhostNotAllowed;
|
|
1201
|
+
const msg = typeof errorMsg === "function" ? errorMsg(input) : errorMsg ?? message`Hostname 'localhost' is not allowed.`;
|
|
1202
|
+
return {
|
|
1203
|
+
success: false,
|
|
1204
|
+
error: msg
|
|
1205
|
+
};
|
|
1206
|
+
}
|
|
1199
1207
|
}
|
|
1200
1208
|
if (!allowUnderscore && input.includes("_")) {
|
|
1201
1209
|
const errorMsg = options?.errors?.underscoreNotAllowed;
|