Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
import React from 'react';
import BabelPolyfill from '@babel/polyfill/package.json';
import { metaKeys } from '../utils/seo';
/**
* CDN Packages for ReactJS and PolyfillJS
*/
const reactCDN = [
`https://unpkg.com/react@${React.version}/umd/react.production.min.js`,
`https://unpkg.com/react-dom@${React.version}/umd/react-dom.production.min.js`,
];
const polyfillVer = BabelPolyfill.version > '7.6.0' ? '7.6.0' : BabelPolyfill.version;
const polyfillCDN = [
`https://cdnjs.cloudflare.com/ajax/libs/babel-polyfill/${polyfillVer}/polyfill.min.js`,
];
/**
* toBase64: atob polyfill with Buffer
*/
let toBase64: (arg0: string) => string;
// Base64 polyfill
if (typeof atob === 'undefined' && typeof Buffer !== 'undefined') {
toBase64 = (str) => {
if (!str) return str;
return Buffer.from(str, 'latin1').toString('base64');
};
} else if (typeof atob !== 'undefined') {
toBase64 = atob;