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

Function normalizeConstraintIdentifier

packages/effect/src/sql/SqlError.ts:525–531  ·  view source on GitHub ↗
(identifier: unknown)

Source from the content-addressed store, hash-verified

523const SQLITE_CONSTRAINT_UNIQUE_CODE = 2067
524
525const normalizeConstraintIdentifier = (identifier: unknown): string => {
526 if (typeof identifier !== "string") {
527 return UNKNOWN_CONSTRAINT
528 }
529 const trimmed = identifier.trim()
530 return trimmed.length === 0 ? UNKNOWN_CONSTRAINT : trimmed
531}
532
533const sqliteUniqueConstraintFromCause = (cause: unknown): string => {
534 if (Predicate.hasProperty(cause, "constraint")) {

Callers 1

Calls 1

trimMethod · 0.80

Tested by

no test coverage detected