@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.
@@ -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;
@@ -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;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@optique/core",
3
- "version": "1.0.0-dev.1169+d2c2243d",
3
+ "version": "1.0.0-dev.1172+53faea83",
4
4
  "description": "Type-safe combinatorial command-line interface parser",
5
5
  "keywords": [
6
6
  "CLI",