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

Function utf8Length

packages/core/src/utils/normalize.ts:255–258  ·  view source on GitHub ↗

Calculates bytes size of input string

(value: string)

Source from the content-addressed store, hash-verified

253
254/** Calculates bytes size of input string */
255function utf8Length(value: string): number {
256 // eslint-disable-next-line no-bitwise
257 return ~-encodeURI(value).split(/%..|./).length;
258}
259
260/** Calculates bytes size of input object */
261// eslint-disable-next-line @typescript-eslint/no-explicit-any

Callers 1

jsonSizeFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected