(version?: 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8, annotations?: Annotations.Filter)
| 6955 | * @since 4.0.0 |
| 6956 | */ |
| 6957 | export function isUUID(version?: 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8, annotations?: Annotations.Filter) { |
| 6958 | const regExp = getUUIDRegExp(version) |
| 6959 | return isPattern( |
| 6960 | regExp, |
| 6961 | { |
| 6962 | expected: version ? `a UUID v${version}` : "a UUID", |
| 6963 | representation: { |
| 6964 | id: "effect/schema/isUUID", |
| 6965 | payload: { version: version ?? null } |
| 6966 | }, |
| 6967 | toJsonSchema: () => ({ pattern: regExp.source, format: "uuid" }), |
| 6968 | toCode: () => ({ runtime: version === undefined ? "Schema.isUUID()" : `Schema.isUUID(${version})` }), |
| 6969 | ...annotations |
| 6970 | } |
| 6971 | ) |
| 6972 | } |
| 6973 | |
| 6974 | /** |
| 6975 | * Reviver for persisted `isUUID` checks. |
no test coverage detected