MCPcopy Create free account
hub / github.com/apache/cloudstack / isBase64

Function isBase64

ui/src/utils/plugins.js:499–506  ·  view source on GitHub ↗
(str)

Source from the content-addressed store, hash-verified

497}
498
499function isBase64 (str) {
500 try {
501 const decoded = new TextDecoder().decode(Uint8Array.from(atob(str), c => c.charCodeAt(0)))
502 return btoa(decoded) === str
503 } catch (err) {
504 return false
505 }
506}
507
508export const genericUtilPlugin = {
509 install (app) {

Callers 1

installFunction · 0.85

Calls 1

decodeMethod · 0.45

Tested by

no test coverage detected