MCPcopy Index your code
hub / github.com/getsentry/sentry-javascript / encodeUTF8

Function encodeUTF8

packages/core/src/utils/envelope.ts:76–79  ·  view source on GitHub ↗

* Encode a string to UTF8 array.

(input: string)

Source from the content-addressed store, hash-verified

74 * Encode a string to UTF8 array.
75 */
76function encodeUTF8(input: string): Uint8Array {
77 const carrier = getSentryCarrier(GLOBAL_OBJ);
78 return carrier.encodePolyfill ? carrier.encodePolyfill(input) : new TextEncoder().encode(input);
79}
80
81/**
82 * Decode a UTF8 array to string.

Callers 3

appendFunction · 0.85
parseEnvelopeFunction · 0.85

Calls 2

getSentryCarrierFunction · 0.90
encodeMethod · 0.80

Tested by

no test coverage detected