Comparing version 0.0.1 to 0.1.0
@@ -6,2 +6,3 @@ | ||
var strip = require('strip-comments') | ||
var transforms = require('polyfills-db').recast.transforms | ||
@@ -12,3 +13,2 @@ require('useragent/features') | ||
var Ecstacy = require('./ecstacy') | ||
var transforms = require('./transforms').transforms | ||
@@ -125,3 +125,3 @@ Ecstacy.prototype.build = function (useragent) { | ||
var ast = this.ast | ||
var ast = this.ast() | ||
transforms.forEach(function (transform) { | ||
@@ -128,0 +128,0 @@ ast = transform.transform(ast) |
@@ -56,18 +56,3 @@ | ||
// lazily parse the AST, allowing developers to set the AST | ||
// themselves if they wish | ||
Object.defineProperties(Ecstacy.prototype, { | ||
ast: { | ||
get: function () { | ||
if (this._ast) return this._ast | ||
return this._ast = recast.parse(this.code, { | ||
sourceFileName: this.hash + '.js' | ||
}) | ||
}, | ||
set: function (ast) { | ||
// particularly important if you already have an AST | ||
// that you can use to avoid double parsing | ||
this._ast = ast | ||
} | ||
}, | ||
cache: { | ||
@@ -82,2 +67,9 @@ // useragent -> bundle cache | ||
// we have to parse on every build :( | ||
Ecstacy.prototype.ast = function () { | ||
return recast.parse(this.code, { | ||
sourceFileName: this.hash + '.js' | ||
}) | ||
} | ||
// add custom transforms | ||
@@ -84,0 +76,0 @@ Ecstacy.prototype.use = function (transform) { |
var Ecstacy = module.exports = require('./ecstacy') | ||
Ecstacy.transforms = require('./transforms') | ||
module.exports = require('./ecstacy') | ||
require('./build') |
{ | ||
"name": "ecstacy", | ||
"description": "transpile JS based on user agents ", | ||
"version": "0.0.1", | ||
"version": "0.1.0", | ||
"author": { | ||
@@ -18,2 +18,3 @@ "name": "Jonathan Ong", | ||
"strip-comments": "0", | ||
"polyfills-db": "0", | ||
"mkdirp": "0", | ||
@@ -40,3 +41,3 @@ "rimraf": "2", | ||
"scripts": { | ||
"test": "mocha --reporter spec", | ||
"test": "mocha --reporter spec --bail", | ||
"test-cov": "istanbul cover node_modules/mocha/bin/_mocha -- --reporter dot", | ||
@@ -43,0 +44,0 @@ "test-travis": "istanbul cover node_modules/mocha/bin/_mocha --report lcovonly -- --reporter dot" |
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
Dynamic require
Supply chain riskDynamic require can indicate the package is performing dangerous or unsafe dynamic code execution.
Found 1 instance in 1 package
2
13581
20
6
269
+ Addedpolyfills-db@0
+ Addedflatten@0.0.1(transitive)
+ Addedmemorizer@1.0.1(transitive)
+ Addedpolyfills-db@0.5.5(transitive)