Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

ecstacy

Package Overview
Dependencies
Maintainers
1
Versions
22
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

ecstacy - npm Package Compare versions

Comparing version 0.0.1 to 0.1.0

4

lib/build.js

@@ -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"

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc