MCPcopy Index your code
hub / github.com/browserless/browserless / isBase64Encoded

Function isBase64Encoded

src/utils.ts:547–547  ·  view source on GitHub ↗
(item: string)

Source from the content-addressed store, hash-verified

545 /^([0-9a-zA-Z+/]{4})*(([0-9a-zA-Z+/]{2}==)|([0-9a-zA-Z+/]{3}=))?$/;
546
547export const isBase64Encoded = (item: string): boolean => isBase64.test(item);
548
549export const convertIfBase64 = (item: string): string =>
550 isBase64Encoded(item) ? Buffer.from(item, 'base64').toString() : item;

Callers 6

readBodyFunction · 0.85
convertIfBase64Function · 0.85
handlerMethod · 0.85
handlerMethod · 0.85
handlerMethod · 0.85
handlerMethod · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected