MCPcopy Index your code
hub / github.com/pgadmin-org/pgadmin4 / stringToBase64

Function stringToBase64

web/pgadmin/static/js/utils.js:609–616  ·  view source on GitHub ↗
(str)

Source from the content-addressed store, hash-verified

607// Using this function instead of 'btoa' directly.
608// https://developer.mozilla.org/en-US/docs/Glossary/Base64#the_unicode_problem
609export function stringToBase64(str) {
610 return btoa(
611 Array.from(
612 new TextEncoder().encode(str),
613 (byte) => String.fromCodePoint(byte),
614 ).join('')
615 );
616}
617
618/************************************
619 *

Callers 1

applyFunction · 0.85

Calls 1

joinMethod · 0.80

Tested by

no test coverage detected