@optique/core 1.0.0-dev.1202 → 1.0.0-dev.1209

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.
@@ -802,7 +802,9 @@ function locale(options = {}) {
802
802
  * By default, the parser enforces strict [RFC 9562] validation: it requires
803
803
  * a standardized version digit (1 through 8) and the RFC 9562 variant bits
804
804
  * (`10xx`). The nil and max UUIDs are accepted as special standard values.
805
- * Set `strict: false` to disable version and variant validation.
805
+ * Set `strict: false` to disable the default RFC 9562 version/variant
806
+ * checks. An explicit {@link UuidOptions.allowedVersions} list still
807
+ * constrains the version nibble even in lenient mode.
806
808
  *
807
809
  * [RFC 9562]: https://www.rfc-editor.org/rfc/rfc9562
808
810
  * @param options Configuration options for the UUID parser.
@@ -813,6 +815,7 @@ function uuid(options = {}) {
813
815
  const uuidRegex = /^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/i;
814
816
  const metavar = options.metavar ?? "UUID";
815
817
  require_nonempty.ensureNonEmptyString(metavar);
818
+ checkBooleanOption(options, "strict");
816
819
  const strict = options.strict !== false;
817
820
  const allowedVersions = options.allowedVersions != null ? Object.freeze([...options.allowedVersions]) : null;
818
821
  const invalidUuid = options.errors?.invalidUuid;
@@ -625,7 +625,9 @@ interface UuidOptions {
625
625
  * By default, the parser enforces strict [RFC 9562] validation: it requires
626
626
  * a standardized version digit (1 through 8) and the RFC 9562 variant bits
627
627
  * (`10xx`). The nil and max UUIDs are accepted as special standard values.
628
- * Set `strict: false` to disable version and variant validation.
628
+ * Set `strict: false` to disable the default RFC 9562 version/variant
629
+ * checks. An explicit {@link UuidOptions.allowedVersions} list still
630
+ * constrains the version nibble even in lenient mode.
629
631
  *
630
632
  * [RFC 9562]: https://www.rfc-editor.org/rfc/rfc9562
631
633
  * @param options Configuration options for the UUID parser.
@@ -625,7 +625,9 @@ interface UuidOptions {
625
625
  * By default, the parser enforces strict [RFC 9562] validation: it requires
626
626
  * a standardized version digit (1 through 8) and the RFC 9562 variant bits
627
627
  * (`10xx`). The nil and max UUIDs are accepted as special standard values.
628
- * Set `strict: false` to disable version and variant validation.
628
+ * Set `strict: false` to disable the default RFC 9562 version/variant
629
+ * checks. An explicit {@link UuidOptions.allowedVersions} list still
630
+ * constrains the version nibble even in lenient mode.
629
631
  *
630
632
  * [RFC 9562]: https://www.rfc-editor.org/rfc/rfc9562
631
633
  * @param options Configuration options for the UUID parser.
@@ -802,7 +802,9 @@ function locale(options = {}) {
802
802
  * By default, the parser enforces strict [RFC 9562] validation: it requires
803
803
  * a standardized version digit (1 through 8) and the RFC 9562 variant bits
804
804
  * (`10xx`). The nil and max UUIDs are accepted as special standard values.
805
- * Set `strict: false` to disable version and variant validation.
805
+ * Set `strict: false` to disable the default RFC 9562 version/variant
806
+ * checks. An explicit {@link UuidOptions.allowedVersions} list still
807
+ * constrains the version nibble even in lenient mode.
806
808
  *
807
809
  * [RFC 9562]: https://www.rfc-editor.org/rfc/rfc9562
808
810
  * @param options Configuration options for the UUID parser.
@@ -813,6 +815,7 @@ function uuid(options = {}) {
813
815
  const uuidRegex = /^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/i;
814
816
  const metavar = options.metavar ?? "UUID";
815
817
  ensureNonEmptyString(metavar);
818
+ checkBooleanOption(options, "strict");
816
819
  const strict = options.strict !== false;
817
820
  const allowedVersions = options.allowedVersions != null ? Object.freeze([...options.allowedVersions]) : null;
818
821
  const invalidUuid = options.errors?.invalidUuid;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@optique/core",
3
- "version": "1.0.0-dev.1202+34b3b6f1",
3
+ "version": "1.0.0-dev.1209+d4c6ddee",
4
4
  "description": "Type-safe combinatorial command-line interface parser",
5
5
  "keywords": [
6
6
  "CLI",