babel-plugin-ember-modules-api-polyfill
Advanced tools
Comparing version 1.6.0 to 2.0.0
{ | ||
"name": "babel-plugin-ember-modules-api-polyfill", | ||
"version": "1.6.0", | ||
"version": "2.0.0", | ||
"description": "Polyfill for Ember JS API.", | ||
@@ -5,0 +5,0 @@ "main": "src/index.js", |
@@ -42,3 +42,2 @@ 'use strict'; | ||
let blacklist = (state.opts && state.opts.blacklist) || []; | ||
let polyfillEmberString = state.opts.polyfillEmberString === undefined ? true : state.opts.polyfillEmberString; | ||
let node = path.node; | ||
@@ -76,8 +75,2 @@ let replacements = []; | ||
if (!polyfillEmberString && importPath === '@ember/string') { | ||
// `@ember/string` is present in the project | ||
// so imports should not be transformed | ||
return; | ||
} | ||
// This is the mapping to use for the import statement | ||
@@ -84,0 +77,0 @@ const mapping = reverseMapping[importPath]; |
@@ -133,22 +133,2 @@ 'use strict'; | ||
}); | ||
describe('polyfillEmberString', () => { | ||
it('converts `@ember/string` by default', assert => { | ||
let input = `import { dasherize } from '@ember/string';`; | ||
let actual = transform(input, [ | ||
[Plugin], | ||
]); | ||
assert.equal(actual, `var dasherize = Ember.String.dasherize;`); | ||
}); | ||
it('allows not polyfilling `@ember/string`', assert => { | ||
let input = `import { dasherize } from '@ember/string';`; | ||
let actual = transform(input, [ | ||
[Plugin, { polyfillEmberString: false }], | ||
]); | ||
assert.equal(actual, input); | ||
}); | ||
}); | ||
}); | ||
@@ -155,0 +135,0 @@ |
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
77848
372