Comparing version 0.1.4 to 0.1.5
@@ -135,4 +135,7 @@ var estraverse = require("estraverse"); | ||
exports.template = function (name, nodes, keepExpression) { | ||
var template = _.cloneDeep(exports.templates[name]); | ||
var template = exports.templates[name]; | ||
if (!template) throw new ReferenceError("unknown template " + name); | ||
template = _.cloneDeep(template); | ||
if (!_.isEmpty(nodes)) { | ||
@@ -201,2 +204,5 @@ traverse.replace(template, function (node) { | ||
var templatesLoc = __dirname + "/templates"; | ||
if (!fs.existsSync(templatesLoc)) { | ||
throw new Error("no templates directory - this is most likely the result of a broken `npm publish`. Please report to https://github.com/sebmck/6to5/issues"); | ||
} | ||
@@ -203,0 +209,0 @@ _.each(fs.readdirSync(templatesLoc), function (name) { |
{ | ||
"name": "6to5", | ||
"description": "Turn ES6 code into vanilla ES5 with no runtime required", | ||
"version": "0.1.4", | ||
"version": "0.1.5", | ||
"author": "Sebastian McKenzie <sebmck@gmail.com>", | ||
@@ -6,0 +6,0 @@ "homepage": "https://github.com/sebmck/6to5", |
@@ -170,3 +170,3 @@ <p align="center"> | ||
When using the [require hook](#require-hook) the aforementioned polyfill is | ||
required. | ||
automatically required. | ||
@@ -176,7 +176,9 @@ If you're planning on using 6to5 output in the browser then it's up to you | ||
and [es6-shim](https://raw.githubusercontent.com/paulmillr/es6-shim/master/es6-shim.js) | ||
support the vast majority of polyfill concerns. | ||
fill the vast majority of polyfill concerns. | ||
#### For-of | ||
Iterator/Symbol polyfill required. | ||
A polyfill is required for for-of functionality that implements `Symbol` and | ||
adds `prototype[Symbol.iterator]` behaviour to built-ins. Using the polyfills | ||
specified in [polyfill](#polyfill) suffices. | ||
@@ -199,4 +201,5 @@ ### Classes | ||
Instead of mapping to a runtime, 6to5 maps directly to the equivalent ES5. This | ||
means that your transpiled code will be as simple as possible. | ||
means that your transpiled code will be as simple as possible and is | ||
**exactly** the equivalent ES5. | ||
### Performance |
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
1058
203
66644
33