Comparing version 0.3.0 to 0.3.1
@@ -0,1 +1,2 @@ | ||
'use strict'; | ||
var esprima = require('esprima'); | ||
@@ -45,5 +46,5 @@ var escodegen = require('escodegen'); | ||
// Prewrap the elements so it isn't consider a list of node | ||
return new ArrayExpression([node.elements]); | ||
return new ArrayExpression([node]); | ||
} | ||
return node; | ||
}; |
@@ -0,1 +1,2 @@ | ||
'use strict'; | ||
var valueFactory = require('../factory/value.js'); | ||
@@ -5,2 +6,6 @@ var Base = require('./Base'); | ||
var ArrayExpression = module.exports = Base.extend({ | ||
initialize: function () { | ||
this.type = 'ArrayExpression'; | ||
}, | ||
/** | ||
@@ -14,3 +19,3 @@ * push a new value in the array | ||
this.nodes.forEach(function (node) { | ||
node.push(arg); | ||
node.elements.push(arg); | ||
}); | ||
@@ -28,3 +33,3 @@ return this; | ||
this.nodes.forEach(function (node) { | ||
node.unshift(arg); | ||
node.elements.unshift(arg); | ||
}); | ||
@@ -40,3 +45,3 @@ return this; | ||
at: function (index) { | ||
return valueFactory.wrap(this.nodes[0][index]); | ||
return valueFactory.wrap(this.nodes[0].elements[index]); | ||
} | ||
@@ -43,0 +48,0 @@ |
@@ -0,1 +1,2 @@ | ||
'use strict'; | ||
var _ = require('lodash'); | ||
@@ -2,0 +3,0 @@ var valueFactory = require('../factory/value.js'); |
@@ -0,1 +1,2 @@ | ||
'use strict'; | ||
var Base = module.exports = function (nodes) { | ||
@@ -2,0 +3,0 @@ this.nodes = Array.isArray(nodes) ? nodes : [nodes]; |
@@ -0,1 +1,2 @@ | ||
'use strict'; | ||
var esprima = require('esprima'); | ||
@@ -2,0 +3,0 @@ |
@@ -0,1 +1,2 @@ | ||
'use strict'; | ||
var valueFactory = require('../factory/value.js'); | ||
@@ -13,3 +14,3 @@ var ArrayExpression = require('./ArrayExpression.js'); | ||
this.type = 'CallExpression'; | ||
this.arguments = new ArrayExpression(this.nodes.map(function (node) { return node.arguments; })); | ||
this.arguments = new ArrayExpression({elements: this.nodes[0].arguments}); | ||
}, | ||
@@ -16,0 +17,0 @@ |
@@ -0,1 +1,2 @@ | ||
'use strict'; | ||
var _ = require('lodash'); | ||
@@ -2,0 +3,0 @@ var valueFactory = require('../factory/value'); |
@@ -0,1 +1,2 @@ | ||
'use strict'; | ||
var _ = require('lodash'); | ||
@@ -2,0 +3,0 @@ var valueFactory = require('../../lib/factory/value.js'); |
@@ -0,1 +1,2 @@ | ||
'use strict'; | ||
var _ = require('lodash'); | ||
@@ -58,3 +59,3 @@ var valueFactory = require('../factory/value.js'); | ||
// the same reference. | ||
delete this.node.property; | ||
delete this.node.properties; | ||
delete this.node.type; | ||
@@ -61,0 +62,0 @@ this.node.TEMP = false; |
@@ -0,1 +1,2 @@ | ||
'use strict'; | ||
var _ = require('lodash'); | ||
@@ -2,0 +3,0 @@ var valueFactory = require('../factory/value.js'); |
@@ -0,4 +1,6 @@ | ||
'use strict'; | ||
var esprima = require('esprima'); | ||
var escodegen = require('escodegen'); | ||
var traverse = require('traverse'); | ||
var _ = require('lodash'); | ||
var utils = require('./util/utils'); | ||
@@ -9,3 +11,2 @@ var Variable = require('./nodes/Variable'); | ||
var Body = require('./nodes/Body'); | ||
var _ = require('lodash'); | ||
@@ -12,0 +13,0 @@ var esprimaOptions = { |
@@ -0,1 +1,2 @@ | ||
'use strict'; | ||
/** | ||
@@ -2,0 +3,0 @@ * Match a MemberExpression node against a name. |
{ | ||
"name": "ast-query", | ||
"version": "0.3.0", | ||
"version": "0.3.1", | ||
"description": "Declarative JavaScript AST modification façade", | ||
@@ -18,20 +18,17 @@ "main": "lib/tree.js", | ||
}, | ||
"repository": { | ||
"type": "git", | ||
"url": "git@github.com:SBoudrias/AST-query.git" | ||
}, | ||
"repository": "SBoudrias/AST-query", | ||
"dependencies": { | ||
"esprima": "~1.1.1", | ||
"escodegen": "~1.3.1", | ||
"lodash": "~2.4.1", | ||
"traverse": "~0.6.6", | ||
"class-extend": "~0.1.1" | ||
"class-extend": "^0.1.1", | ||
"escodegen": "^1.6.0", | ||
"esprima": "^1.2.3", | ||
"lodash": "^2.4.1", | ||
"traverse": "^0.6.6" | ||
}, | ||
"devDependencies": { | ||
"grunt": "~0.4.1", | ||
"grunt-cli": "~0.1.9", | ||
"grunt-contrib-jshint": "~0.10.0", | ||
"grunt-simple-mocha": "~0.4.0", | ||
"grunt-release": "~0.7.0" | ||
"grunt": "^0.4.5", | ||
"grunt-cli": "^0.1.9", | ||
"grunt-contrib-jshint": "^0.11.0", | ||
"grunt-release": "^0.10.0", | ||
"grunt-simple-mocha": "^0.4.0" | ||
} | ||
} |
@@ -31,3 +31,3 @@ var assert = require('assert'); | ||
obj.var('b').value().key('c').value('1'); | ||
assert.equal(obj.toString(), 'var b = {\n a: null,\n c: 1\n };'); | ||
assert.equal(obj.toString(), 'var b = {\n a: null,\n c: 1\n};'); | ||
}); | ||
@@ -34,0 +34,0 @@ |
Sorry, the diff of this file is not supported yet
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
No repository
Supply chain riskPackage does not have a linked source code repository. Without this field, a package will have no reference to the location of the source code use to generate the 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
35173
29
792
1
+ Addeddeep-is@0.1.4(transitive)
+ Addedescodegen@1.14.3(transitive)
+ Addedesprima@1.2.54.0.1(transitive)
+ Addedestraverse@4.3.0(transitive)
+ Addedesutils@2.0.3(transitive)
+ Addedfast-levenshtein@2.0.6(transitive)
+ Addedlevn@0.3.0(transitive)
+ Addedoptionator@0.8.3(transitive)
+ Addedprelude-ls@1.1.2(transitive)
+ Addedsource-map@0.6.1(transitive)
+ Addedtype-check@0.3.2(transitive)
+ Addedword-wrap@1.2.5(transitive)
- Removedamdefine@1.0.1(transitive)
- Removedescodegen@1.3.3(transitive)
- Removedesprima@1.1.1(transitive)
- Removedestraverse@1.5.1(transitive)
- Removedesutils@1.0.0(transitive)
- Removedsource-map@0.1.43(transitive)
Updatedclass-extend@^0.1.1
Updatedescodegen@^1.6.0
Updatedesprima@^1.2.3
Updatedlodash@^2.4.1
Updatedtraverse@^0.6.6