MCPcopy Create free account
hub / github.com/Effect-TS/effect / normalizeConstraintIdentifier

Function normalizeConstraintIdentifier

packages/sql/mysql2/src/MysqlClient.ts:61–67  ·  view source on GitHub ↗
(identifier: unknown)

Source from the content-addressed store, hash-verified

59const UNKNOWN_CONSTRAINT = "unknown"
60
61const 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
69const mysqlCauseProperty = (cause: unknown, property: "constraint" | "message" | "sqlMessage"): unknown => {
70 if (typeof cause !== "object" || cause === null || !(property in cause)) {

Calls

no outgoing calls

Tested by

no test coverage detected