zod 4.1.0-canary.20250711T200924 → 4.1.0-canary.20250711T201420
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/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "zod",
|
|
3
|
-
"version": "4.1.0-canary.
|
|
3
|
+
"version": "4.1.0-canary.20250711T201420",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"author": "Colin McDonnell <zod@colinhacks.com>",
|
|
6
6
|
"description": "TypeScript-first schema declaration and validation library with static type inference",
|
|
@@ -342,8 +342,8 @@ test("uuid", () => {
|
|
|
342
342
|
uuid.parse("9491d710-3185-4e06-bea0-6a2f275345e0");
|
|
343
343
|
uuid.parse("d89e7b01-7598-ed11-9d7a-0022489382fd"); // new sequential id
|
|
344
344
|
uuid.parse("00000000-0000-0000-0000-000000000000");
|
|
345
|
-
uuid.parse("b3ce60f8-e8b9-40f5-1150-172ede56ff74"); // Variant 0 - RFC 4122: Reserved, NCS backward compatibility
|
|
346
|
-
uuid.parse("92e76bf9-28b3-4730-cd7f-cb6bc51f8c09"); // Variant 2 - RFC 4122: Reserved, Microsoft Corporation backward compatibility
|
|
345
|
+
uuid.parse("b3ce60f8-e8b9-40f5-1150-172ede56ff74"); // Variant 0 - RFC 9562/4122: Reserved, NCS backward compatibility
|
|
346
|
+
uuid.parse("92e76bf9-28b3-4730-cd7f-cb6bc51f8c09"); // Variant 2 - RFC 9562/4122: Reserved, Microsoft Corporation backward compatibility
|
|
347
347
|
const result = uuid.safeParse("9491d710-3185-4e06-bea0-6a2f275345e0X");
|
|
348
348
|
expect(result.success).toEqual(false);
|
|
349
349
|
if (!result.success) {
|
|
@@ -464,8 +464,8 @@ test(`bad uuid`, () => {
|
|
|
464
464
|
"9491d710-3185-0e06-bea0-6a2f275345e0",
|
|
465
465
|
"9491d710-3185-5e06-0ea0-6a2f275345e0",
|
|
466
466
|
"d89e7b01-7598-ed11-9d7a-0022489382fd", // new sequential id
|
|
467
|
-
"b3ce60f8-e8b9-40f5-1150-172ede56ff74", // Variant 0 - RFC 4122: Reserved, NCS backward compatibility
|
|
468
|
-
"92e76bf9-28b3-4730-cd7f-cb6bc51f8c09", // Variant 2 - RFC 4122: Reserved, Microsoft Corporation backward compatibility
|
|
467
|
+
"b3ce60f8-e8b9-40f5-1150-172ede56ff74", // Variant 0 - RFC 9562/4122: Reserved, NCS backward compatibility
|
|
468
|
+
"92e76bf9-28b3-4730-cd7f-cb6bc51f8c09", // Variant 2 - RFC 9562/4122: Reserved, Microsoft Corporation backward compatibility
|
|
469
469
|
"invalid uuid",
|
|
470
470
|
"9491d710-3185-4e06-bea0-6a2f275345e0X",
|
|
471
471
|
"ffffffff-ffff-ffff-ffff-ffffffffffff",
|
|
@@ -481,8 +481,8 @@ test("good guid", () => {
|
|
|
481
481
|
for (const goodGuid of [
|
|
482
482
|
"9491d710-3185-4e06-bea0-6a2f275345e0",
|
|
483
483
|
"d89e7b01-7598-ed11-9d7a-0022489382fd", // new sequential id
|
|
484
|
-
"b3ce60f8-e8b9-40f5-1150-172ede56ff74", // Variant 0 - RFC 4122: Reserved, NCS backward compatibility
|
|
485
|
-
"92e76bf9-28b3-4730-cd7f-cb6bc51f8c09", // Variant 2 - RFC 4122: Reserved, Microsoft Corporation backward compatibility
|
|
484
|
+
"b3ce60f8-e8b9-40f5-1150-172ede56ff74", // Variant 0 - RFC 9562/4122: Reserved, NCS backward compatibility
|
|
485
|
+
"92e76bf9-28b3-4730-cd7f-cb6bc51f8c09", // Variant 2 - RFC 9562/4122: Reserved, Microsoft Corporation backward compatibility
|
|
486
486
|
"00000000-0000-0000-0000-000000000000",
|
|
487
487
|
"ffffffff-ffff-ffff-ffff-ffffffffffff",
|
|
488
488
|
]) {
|
package/src/v4/core/regexes.ts
CHANGED
|
@@ -16,7 +16,7 @@ export const extendedDuration: RegExp =
|
|
|
16
16
|
/** A regex for any UUID-like identifier: 8-4-4-4-12 hex pattern */
|
|
17
17
|
export const guid: RegExp = /^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$/;
|
|
18
18
|
|
|
19
|
-
/** Returns a regex for validating an RFC 4122 UUID.
|
|
19
|
+
/** Returns a regex for validating an RFC 9562/4122 UUID.
|
|
20
20
|
*
|
|
21
21
|
* @param version Optionally specify a version 1-8. If no version is specified, all versions are supported. */
|
|
22
22
|
export const uuid = (version?: number | undefined): RegExp => {
|
package/v4/core/regexes.cjs
CHANGED
|
@@ -16,7 +16,7 @@ exports.duration = /^P(?:(\d+W)|(?!.*W)(?=\d|T\d)(\d+Y)?(\d+M)?(\d+D)?(T(?=\d)(\
|
|
|
16
16
|
exports.extendedDuration = /^[-+]?P(?!$)(?:(?:[-+]?\d+Y)|(?:[-+]?\d+[.,]\d+Y$))?(?:(?:[-+]?\d+M)|(?:[-+]?\d+[.,]\d+M$))?(?:(?:[-+]?\d+W)|(?:[-+]?\d+[.,]\d+W$))?(?:(?:[-+]?\d+D)|(?:[-+]?\d+[.,]\d+D$))?(?:T(?=[\d+-])(?:(?:[-+]?\d+H)|(?:[-+]?\d+[.,]\d+H$))?(?:(?:[-+]?\d+M)|(?:[-+]?\d+[.,]\d+M$))?(?:[-+]?\d+(?:[.,]\d+)?S)?)??$/;
|
|
17
17
|
/** A regex for any UUID-like identifier: 8-4-4-4-12 hex pattern */
|
|
18
18
|
exports.guid = /^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$/;
|
|
19
|
-
/** Returns a regex for validating an RFC 4122 UUID.
|
|
19
|
+
/** Returns a regex for validating an RFC 9562/4122 UUID.
|
|
20
20
|
*
|
|
21
21
|
* @param version Optionally specify a version 1-8. If no version is specified, all versions are supported. */
|
|
22
22
|
const uuid = (version) => {
|
package/v4/core/regexes.d.cts
CHANGED
|
@@ -10,7 +10,7 @@ export declare const duration: RegExp;
|
|
|
10
10
|
export declare const extendedDuration: RegExp;
|
|
11
11
|
/** A regex for any UUID-like identifier: 8-4-4-4-12 hex pattern */
|
|
12
12
|
export declare const guid: RegExp;
|
|
13
|
-
/** Returns a regex for validating an RFC 4122 UUID.
|
|
13
|
+
/** Returns a regex for validating an RFC 9562/4122 UUID.
|
|
14
14
|
*
|
|
15
15
|
* @param version Optionally specify a version 1-8. If no version is specified, all versions are supported. */
|
|
16
16
|
export declare const uuid: (version?: number | undefined) => RegExp;
|
package/v4/core/regexes.d.ts
CHANGED
|
@@ -10,7 +10,7 @@ export declare const duration: RegExp;
|
|
|
10
10
|
export declare const extendedDuration: RegExp;
|
|
11
11
|
/** A regex for any UUID-like identifier: 8-4-4-4-12 hex pattern */
|
|
12
12
|
export declare const guid: RegExp;
|
|
13
|
-
/** Returns a regex for validating an RFC 4122 UUID.
|
|
13
|
+
/** Returns a regex for validating an RFC 9562/4122 UUID.
|
|
14
14
|
*
|
|
15
15
|
* @param version Optionally specify a version 1-8. If no version is specified, all versions are supported. */
|
|
16
16
|
export declare const uuid: (version?: number | undefined) => RegExp;
|
package/v4/core/regexes.js
CHANGED
|
@@ -10,7 +10,7 @@ export const duration = /^P(?:(\d+W)|(?!.*W)(?=\d|T\d)(\d+Y)?(\d+M)?(\d+D)?(T(?=
|
|
|
10
10
|
export const extendedDuration = /^[-+]?P(?!$)(?:(?:[-+]?\d+Y)|(?:[-+]?\d+[.,]\d+Y$))?(?:(?:[-+]?\d+M)|(?:[-+]?\d+[.,]\d+M$))?(?:(?:[-+]?\d+W)|(?:[-+]?\d+[.,]\d+W$))?(?:(?:[-+]?\d+D)|(?:[-+]?\d+[.,]\d+D$))?(?:T(?=[\d+-])(?:(?:[-+]?\d+H)|(?:[-+]?\d+[.,]\d+H$))?(?:(?:[-+]?\d+M)|(?:[-+]?\d+[.,]\d+M$))?(?:[-+]?\d+(?:[.,]\d+)?S)?)??$/;
|
|
11
11
|
/** A regex for any UUID-like identifier: 8-4-4-4-12 hex pattern */
|
|
12
12
|
export const guid = /^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$/;
|
|
13
|
-
/** Returns a regex for validating an RFC 4122 UUID.
|
|
13
|
+
/** Returns a regex for validating an RFC 9562/4122 UUID.
|
|
14
14
|
*
|
|
15
15
|
* @param version Optionally specify a version 1-8. If no version is specified, all versions are supported. */
|
|
16
16
|
export const uuid = (version) => {
|