@optique/core 1.0.0-dev.1583 → 1.0.0-dev.1590

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.
@@ -1659,6 +1659,7 @@ function socketAddress(options) {
1659
1659
  const separator = options?.separator ?? ":";
1660
1660
  if (separator === "") throw new TypeError("Expected separator to not be empty.");
1661
1661
  if (/\p{Nd}/u.test(separator)) throw new TypeError(`Expected separator to not contain digits, but got: ${JSON.stringify(separator)}.`);
1662
+ const formatExample = `host${JSON.stringify(separator).slice(1, -1)}port`;
1662
1663
  const metavar = options?.metavar ?? `HOST${separator}PORT`;
1663
1664
  require_nonempty.ensureNonEmptyString(metavar);
1664
1665
  const defaultPort = options?.defaultPort;
@@ -1820,7 +1821,7 @@ function socketAddress(options) {
1820
1821
  const portSplitHostIsDegenerate = separatorIsHostChar ? firstHostError.hostPart.replaceAll(separator, "") === "" : firstHostError.hostPart.includes(separator);
1821
1822
  if (portSplitHostIsDegenerate) return {
1822
1823
  success: false,
1823
- error: require_message.message`Expected a socket address in format host${separator}port, but got ${input}.`
1824
+ error: require_message.message`Expected a socket address in format ${require_message.text(formatExample)}, but got ${input}.`
1824
1825
  };
1825
1826
  if (!disambiguationParser.parse(trimmed).success) return {
1826
1827
  success: false,
@@ -1829,7 +1830,7 @@ function socketAddress(options) {
1829
1830
  }
1830
1831
  if (disambiguationParser.parse(trimmed).success) return {
1831
1832
  success: false,
1832
- error: require_message.message`Expected a socket address in format host${separator}port, but got ${input}.`
1833
+ error: require_message.message`Expected a socket address in format ${require_message.text(formatExample)}, but got ${input}.`
1833
1834
  };
1834
1835
  return {
1835
1836
  success: false,
@@ -1943,7 +1944,7 @@ function socketAddress(options) {
1943
1944
  }
1944
1945
  return {
1945
1946
  success: false,
1946
- error: require_message.message`Expected a socket address in format host${separator}port, but got ${input}.`
1947
+ error: require_message.message`Expected a socket address in format ${require_message.text(formatExample)}, but got ${input}.`
1947
1948
  };
1948
1949
  },
1949
1950
  format(value) {
@@ -1659,6 +1659,7 @@ function socketAddress(options) {
1659
1659
  const separator = options?.separator ?? ":";
1660
1660
  if (separator === "") throw new TypeError("Expected separator to not be empty.");
1661
1661
  if (/\p{Nd}/u.test(separator)) throw new TypeError(`Expected separator to not contain digits, but got: ${JSON.stringify(separator)}.`);
1662
+ const formatExample = `host${JSON.stringify(separator).slice(1, -1)}port`;
1662
1663
  const metavar = options?.metavar ?? `HOST${separator}PORT`;
1663
1664
  ensureNonEmptyString(metavar);
1664
1665
  const defaultPort = options?.defaultPort;
@@ -1820,7 +1821,7 @@ function socketAddress(options) {
1820
1821
  const portSplitHostIsDegenerate = separatorIsHostChar ? firstHostError.hostPart.replaceAll(separator, "") === "" : firstHostError.hostPart.includes(separator);
1821
1822
  if (portSplitHostIsDegenerate) return {
1822
1823
  success: false,
1823
- error: message`Expected a socket address in format host${separator}port, but got ${input}.`
1824
+ error: message`Expected a socket address in format ${text(formatExample)}, but got ${input}.`
1824
1825
  };
1825
1826
  if (!disambiguationParser.parse(trimmed).success) return {
1826
1827
  success: false,
@@ -1829,7 +1830,7 @@ function socketAddress(options) {
1829
1830
  }
1830
1831
  if (disambiguationParser.parse(trimmed).success) return {
1831
1832
  success: false,
1832
- error: message`Expected a socket address in format host${separator}port, but got ${input}.`
1833
+ error: message`Expected a socket address in format ${text(formatExample)}, but got ${input}.`
1833
1834
  };
1834
1835
  return {
1835
1836
  success: false,
@@ -1943,7 +1944,7 @@ function socketAddress(options) {
1943
1944
  }
1944
1945
  return {
1945
1946
  success: false,
1946
- error: message`Expected a socket address in format host${separator}port, but got ${input}.`
1947
+ error: message`Expected a socket address in format ${text(formatExample)}, but got ${input}.`
1947
1948
  };
1948
1949
  },
1949
1950
  format(value) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@optique/core",
3
- "version": "1.0.0-dev.1583+82b74b4b",
3
+ "version": "1.0.0-dev.1590+eb65aeba",
4
4
  "description": "Type-safe combinatorial command-line interface parser",
5
5
  "keywords": [
6
6
  "CLI",