Fix few typos
This commit is contained in:
parent
80f93f3d87
commit
69870774e7
@ -13,7 +13,7 @@ import transformPolyfillRequirePlugin from "./transform-polyfill-require-plugin"
|
||||
* @param {Object} supportedEnvironments An Object containing environment keys and the lowest
|
||||
* supported version as a value
|
||||
* @param {Object} plugin An Object containing environment keys and the lowest
|
||||
* version the feature was implmented in as a value
|
||||
* version the feature was implemented in as a value
|
||||
* @return {Boolean} Whether or not the transformation is required
|
||||
*/
|
||||
export const isPluginRequired = (supportedEnvironments, plugin) => {
|
||||
@ -158,7 +158,7 @@ const filterItem = (targets, exclusions, list, item) => {
|
||||
return isRequired && notExcluded;
|
||||
};
|
||||
|
||||
export const transformIncludesAndExculdes = (opts) => ({
|
||||
export const transformIncludesAndExcludes = (opts) => ({
|
||||
all: opts,
|
||||
plugins: opts.filter((opt) => !opt.match(/^(es\d+|web)\./)),
|
||||
builtIns: opts.filter((opt) => opt.match(/^(es\d+|web)\./))
|
||||
@ -169,8 +169,8 @@ export default function buildPreset(context, opts = {}) {
|
||||
const {debug, loose, moduleType, useBuiltIns} = validatedOptions;
|
||||
|
||||
const targets = getTargets(validatedOptions.targets);
|
||||
const include = transformIncludesAndExculdes(validatedOptions.include);
|
||||
const exclude = transformIncludesAndExculdes(validatedOptions.exclude);
|
||||
const include = transformIncludesAndExcludes(validatedOptions.include);
|
||||
const exclude = transformIncludesAndExcludes(validatedOptions.exclude);
|
||||
|
||||
const filterPlugins = filterItem.bind(null, targets, exclude.plugins, pluginList);
|
||||
const transformations = Object.keys(pluginList)
|
||||
|
||||
@ -137,7 +137,7 @@ describe("babel-preset-env", () => {
|
||||
assert(babelPresetEnv.isPluginRequired(targets, plugin) === true);
|
||||
});
|
||||
|
||||
it("doesn't throw when specifiying a decimal for node", () => {
|
||||
it("doesn't throw when specifying a decimal for node", () => {
|
||||
const plugin = {
|
||||
node: 6
|
||||
};
|
||||
@ -166,10 +166,10 @@ describe("babel-preset-env", () => {
|
||||
});
|
||||
});
|
||||
|
||||
describe("transformIncludesAndExculdes", function() {
|
||||
describe("transformIncludesAndExcludes", function() {
|
||||
it("should return in transforms array", function() {
|
||||
assert.deepEqual(
|
||||
babelPresetEnv.transformIncludesAndExculdes(["transform-es2015-arrow-functions"]),
|
||||
babelPresetEnv.transformIncludesAndExcludes(["transform-es2015-arrow-functions"]),
|
||||
{
|
||||
all: ["transform-es2015-arrow-functions"],
|
||||
plugins: ["transform-es2015-arrow-functions"],
|
||||
@ -180,7 +180,7 @@ describe("babel-preset-env", () => {
|
||||
|
||||
it("should return in built-ins array", function() {
|
||||
assert.deepEqual(
|
||||
babelPresetEnv.transformIncludesAndExculdes(["es6.map"]),
|
||||
babelPresetEnv.transformIncludesAndExcludes(["es6.map"]),
|
||||
{
|
||||
all: ["es6.map"],
|
||||
plugins: [],
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user