broccoli-babel-transpiler
Advanced tools
Comparing version 4.0.0 to 4.0.1
22
index.js
@@ -7,5 +7,5 @@ 'use strict'; | ||
function SixToFive(inputTree, options) { | ||
if (!(this instanceof SixToFive)) { | ||
return new SixToFive(inputTree, options); | ||
function Babel(inputTree, options) { | ||
if (!(this instanceof Babel)) { | ||
return new Babel(inputTree, options); | ||
} | ||
@@ -17,13 +17,13 @@ | ||
SixToFive.prototype = Object.create(Filter.prototype); | ||
SixToFive.prototype.constructor = SixToFive; | ||
Babel.prototype = Object.create(Filter.prototype); | ||
Babel.prototype.constructor = Babel; | ||
SixToFive.prototype.extensions = ['js']; | ||
SixToFive.prototype.targetExtension = 'js'; | ||
Babel.prototype.extensions = ['js']; | ||
Babel.prototype.targetExtension = 'js'; | ||
SixToFive.prototype.transform = function(string, options) { | ||
Babel.prototype.transform = function(string, options) { | ||
return transpiler.transform(string, options); | ||
}; | ||
SixToFive.prototype.processString = function (string, relativePath) { | ||
Babel.prototype.processString = function (string, relativePath) { | ||
var options = this.copyOptions(); | ||
@@ -36,6 +36,6 @@ | ||
SixToFive.prototype.copyOptions = function() { | ||
Babel.prototype.copyOptions = function() { | ||
return clone(this.options); | ||
}; | ||
module.exports = SixToFive; | ||
module.exports = Babel; |
{ | ||
"name": "broccoli-babel-transpiler", | ||
"version": "4.0.0", | ||
"version": "4.0.1", | ||
"description": "A Broccoli plugin which transpile ES6 to readable ES5 by using babel.", | ||
@@ -5,0 +5,0 @@ "main": "index.js", |
16
test.js
@@ -7,3 +7,3 @@ 'use strict'; | ||
var path = require('path'); | ||
var to5 = require('./index'); | ||
var Babel = require('./index'); | ||
@@ -14,3 +14,3 @@ var builder; | ||
function build(path, options) { | ||
builder = new broccoli.Builder(to5(path, options)); | ||
builder = new broccoli.Builder(new Babel(path, options)); | ||
@@ -23,3 +23,3 @@ return builder.build(); | ||
var options, toFive; | ||
var options, babel; | ||
@@ -34,3 +34,3 @@ before(function() { | ||
toFive = new to5('', options); | ||
babel = new Babel('', options); | ||
}); | ||
@@ -41,3 +41,3 @@ | ||
toFive.transform = function(string, options) { | ||
babel.transform = function(string, options) { | ||
transpilerOptions = options; | ||
@@ -48,3 +48,3 @@ return { code: {} }; | ||
expect(transpilerOptions).to.eql(undefined); | ||
toFive.processString('path', 'relativePath'); | ||
babel.processString('path', 'relativePath'); | ||
@@ -64,3 +64,3 @@ expect(transpilerOptions.foo).to.eql(1); | ||
toFive.transform = function(string, options) { | ||
babel.transform = function(string, options) { | ||
transpilerOptions = options; | ||
@@ -71,3 +71,3 @@ return { code: {} }; | ||
expect(transpilerOptions).to.eql(undefined); | ||
toFive.processString('path', 'relativePath'); | ||
babel.processString('path', 'relativePath'); | ||
@@ -74,0 +74,0 @@ expect(transpilerOptions.filename).to.eql('relativePath'); |
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
New author
Supply chain riskA new npm collaborator published a version of the package for the first time. New collaborators are usually benign additions to a project, but do indicate a change to the security surface area of a package.
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
6785
1