(identifier: unknown)
| 59 | const UNKNOWN_CONSTRAINT = "unknown" |
| 60 | |
| 61 | const normalizeConstraintIdentifier = (identifier: unknown): string => { |
| 62 | if (typeof identifier !== "string") { |
| 63 | return UNKNOWN_CONSTRAINT |
| 64 | } |
| 65 | const trimmed = identifier.trim() |
| 66 | return trimmed.length === 0 ? UNKNOWN_CONSTRAINT : trimmed |
| 67 | } |
| 68 | |
| 69 | const mysqlCauseProperty = (cause: unknown, property: "constraint" | "message" | "sqlMessage"): unknown => { |
| 70 | if (typeof cause !== "object" || cause === null || !(property in cause)) { |
no outgoing calls
no test coverage detected