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

Function normalizeConstraintIdentifier

packages/sql/mssql/src/MssqlClient.ts:71–77  ·  view source on GitHub ↗
(identifier: unknown)

Source from the content-addressed store, hash-verified

69const UNKNOWN_CONSTRAINT = "unknown"
70
71const normalizeConstraintIdentifier = (identifier: unknown): string => {
72 if (typeof identifier !== "string") {
73 return UNKNOWN_CONSTRAINT
74 }
75 const trimmed = identifier.trim()
76 return trimmed.length === 0 ? UNKNOWN_CONSTRAINT : trimmed
77}
78
79const mssqlCauseProperty = (cause: unknown, property: "constraint" | "message"): unknown => {
80 if (typeof cause !== "object" || cause === null || !(property in cause)) {

Calls

no outgoing calls

Tested by

no test coverage detected