babel-plugin-ember-modules-api-polyfill
Advanced tools
Comparing version 2.3.0 to 2.3.1
{ | ||
"name": "babel-plugin-ember-modules-api-polyfill", | ||
"version": "2.3.0", | ||
"version": "2.3.1", | ||
"description": "Polyfill for Ember JS API.", | ||
@@ -5,0 +5,0 @@ "main": "src/index.js", |
@@ -55,10 +55,15 @@ 'use strict'; | ||
let local = specifierPath.node.local; | ||
if (local.name !== 'Ember') { | ||
replacements.push([ | ||
local.name, | ||
'Ember', | ||
]); | ||
if (specifierPath) { | ||
let local = specifierPath.node.local; | ||
if (local.name !== 'Ember') { | ||
replacements.push([ | ||
local.name, | ||
'Ember', | ||
]); | ||
} | ||
removals.push(specifierPath); | ||
} else { | ||
// import 'ember'; | ||
path.remove(); | ||
} | ||
removals.push(specifierPath); | ||
} | ||
@@ -89,2 +94,5 @@ | ||
) { | ||
if (specifier.type === 'ImportNamespaceSpecifier') { | ||
throw new Error(`Using \`import * as ${specifier.local} from '${importPath}'\` is not supported.`); | ||
} | ||
return; | ||
@@ -91,0 +99,0 @@ } |
@@ -135,2 +135,12 @@ 'use strict'; | ||
it(`throws an error for wildcard imports`, assert => { | ||
let input = `import * as debug from '@ember/debug';`; | ||
assert.throws(() => { | ||
transform(input, [ | ||
[Plugin], | ||
]); | ||
}, 'Using `import * as debug from \'@ember/debug\'` is not supported'); | ||
}); | ||
it(`throws an error for wildcard exports`, assert => { | ||
@@ -210,2 +220,6 @@ let input = `export * from '@ember/object/computed';`; | ||
matches( | ||
`import 'ember';`, | ||
`` | ||
); | ||
matches( | ||
`import './foo';`, | ||
@@ -212,0 +226,0 @@ `import './foo';` |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
104491
12
514