@clerk/shared
Version:
Internal package utils used by the Clerk SDKs
1 lines • 814 B
Source Map (JSON)
{"version":3,"sources":["../src/isomorphicAtob.ts"],"sourcesContent":["/**\n * A function that decodes a string of data which has been encoded using base-64 encoding.\n * Uses `atob` if available, otherwise uses `Buffer` from `global`. If neither are available, returns the data as-is.\n */\nexport const isomorphicAtob = (data: string) => {\n if (typeof atob !== 'undefined' && typeof atob === 'function') {\n return atob(data);\n } else if (typeof global !== 'undefined' && global.Buffer) {\n return new global.Buffer(data, 'base64').toString();\n }\n return data;\n};\n"],"mappings":";AAIO,IAAM,iBAAiB,CAAC,SAAiB;AAC9C,MAAI,OAAO,SAAS,eAAe,OAAO,SAAS,YAAY;AAC7D,WAAO,KAAK,IAAI;AAAA,EAClB,WAAW,OAAO,WAAW,eAAe,OAAO,QAAQ;AACzD,WAAO,IAAI,OAAO,OAAO,MAAM,QAAQ,EAAE,SAAS;AAAA,EACpD;AACA,SAAO;AACT;","names":[]}