Skip to content

Open-Source API Development Ecosystem • https://hoppscotch.io • Offline, On-Prem & Cloud • Web, Desktop & CLI • Open-Source Alternative to Postman, Insomnia

220 B
Raw Blame
import * as E from "fp-ts/Either"

export const decodeToString = (content: Uint8Array): E.Either<Error, string> =>
  E.tryCatch(
    () => new TextDecoder("utf-8").decode(content).replace(/\x00/g, ""),
    E.toError
  )