Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
module.exports = function(babel) {
const t = babel.types;
// Flips the ember-rfc176-data mapping into an 'import' indexed object, that exposes the
// default import as well as named imports, e.g. import {foo} from 'bar'
const reverseMapping = {};
mapping.forEach(exportDefinition => {
const imported = exportDefinition.global;
const importRoot = exportDefinition.module;
let importName = exportDefinition.export;
if (!reverseMapping[importRoot]) {
reverseMapping[importRoot] = {};
}
reverseMapping[importRoot][importName] = imported;
});
return {
name: 'ember-modules-api-polyfill',
visitor: {
ImportDeclaration(path, state) {
let blacklist = (state.opts && state.opts.blacklist) || [];