Comparing version 0.3.0 to 0.4.0
var fs = require('fs'); | ||
var through = require('through'); | ||
var es6templates = require('es6-templates'); | ||
var es6arrowfn = require('es6-arrow-function'); | ||
var es6class = require('es6-class'); | ||
var es6restParams = require('es6-rest-params'); | ||
var es6templates = require('es6-templates'); | ||
var regenerator = require('regenerator'); | ||
@@ -51,2 +52,4 @@ | ||
* generator - Compile generator functions into ES5. Default: on. | ||
* rest - Compile rest params into ES5. Default: on. | ||
* templates - Compile template strings into ES5. Default: on. | ||
* | ||
@@ -60,6 +63,2 @@ * @param {object} ast | ||
if (options.templates !== false) { | ||
ast = es6templates.transform(ast); | ||
} | ||
if (options.arrowFunction !== false) { | ||
@@ -77,2 +76,10 @@ ast = es6arrowfn.transform(ast); | ||
if (options.rest !== false) { | ||
ast = es6restParams.transform(ast); | ||
} | ||
if (options.templates !== false) { | ||
ast = es6templates.transform(ast); | ||
} | ||
if (options.includeRuntime) { | ||
@@ -79,0 +86,0 @@ var runtime = fs.readFileSync(regenerator.runtime.dev, 'utf8'); |
{ | ||
"name": "esnext", | ||
"version": "0.3.0", | ||
"version": "0.4.0", | ||
"description": "Transform next-generation JavaScript to today's JavaScript.", | ||
@@ -23,6 +23,7 @@ "main": "lib/index.js", | ||
"devDependencies": { | ||
"example-runner": "^0.0.3" | ||
"example-runner": "^0.0.3", | ||
"es6-rest-params": "^0.1.0" | ||
}, | ||
"dependencies": { | ||
"es6-class": "^0.3.0", | ||
"es6-class": "^0.3.1", | ||
"es6-arrow-function": "^0.3.0", | ||
@@ -29,0 +30,0 @@ "regenerator": "^0.4.5", |
@@ -34,2 +34,3 @@ # esnext | ||
* template strings (via [es6-templates][es6-templates]) | ||
* rest params (via [es6-rest-params][es6-rest-params]) | ||
@@ -40,3 +41,2 @@ ### TODO | ||
* spread arguments | ||
* rest parameters | ||
* block scoping (`let`) | ||
@@ -108,2 +108,3 @@ * destructuring | ||
[es6-module-transpiler]: https://github.com/square/es6-module-transpiler | ||
[es6-rest-params]: https://github.com/thomasboyt/es6-rest-params | ||
[es6-templates]: https://github.com/square/es6-templates | ||
@@ -110,0 +111,0 @@ [es6features]: https://github.com/lukehoban/es6features |
@@ -23,2 +23,6 @@ /* jshint esnext:true */ | ||
} | ||
static forCounts(...counts) { | ||
return counts.map(count => new this(count)); | ||
} | ||
} | ||
@@ -49,1 +53,6 @@ | ||
assert.equal(counter.toString(), '[Counter count=13]'); | ||
assert.deepEqual( | ||
Counter.forCounts(9, 99).map(counter => counter.count), | ||
[9, 99] | ||
); |
11354
12
216
113
2
Updatedes6-class@^0.3.1