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

Function decodeUtf8

packages/sql/pg/src/PgAuth.ts:78–84  ·  view source on GitHub ↗
(bytes: Uint8Array, what: string)

Source from the content-addressed store, hash-verified

76}
77
78const decodeUtf8 = (bytes: Uint8Array, what: string): string => {
79 try {
80 return textDecoder.decode(bytes)
81 } catch {
82 return fail(`Invalid UTF-8 in ${what}`)
83 }
84}
85
86/**
87 * Computes the password string for an `AuthenticationMD5Password` challenge:

Callers 2

scramContinueUnsafeFunction · 0.70
scramFinishUnsafeFunction · 0.70

Calls 2

failFunction · 0.70
decodeMethod · 0.45

Tested by

no test coverage detected