ng-test-utils
Advanced tools
Comparing version 0.0.1 to 0.0.2
{ | ||
"name": "ng-test-utils", | ||
"version": "0.0.1", | ||
"version": "0.0.2", | ||
"description": "angular test utilities", | ||
"main": "index.js", | ||
"scripts": { | ||
"test": "mocha mocha-globals.js test/**/*-test.js", | ||
"lint": "jshint src/** test/**", | ||
"test": "npm run lint && npm run cover", | ||
"test-nohack": "mocha mocha-globals.js test/**/*-test.js", | ||
"test-hack": "RECAST_COMMENT_HACK=true mocha mocha-globals.js test/**/*-test.js", | ||
@@ -30,7 +32,3 @@ "watch": "mocha -w --growl mocha-globals.js test/**/*-test.js", | ||
"ast-types": "^0.6.15", | ||
"merge": "^1.2.0", | ||
"recast": "^0.10.1", | ||
"source-map": "^0.4.0", | ||
"through2": "^0.6.3", | ||
"transformify": "^0.1.2" | ||
"recast": "^0.10.1" | ||
}, | ||
@@ -43,2 +41,3 @@ "devDependencies": { | ||
"istanbul": "^0.3.6", | ||
"jshint": "^2.6.3", | ||
"mocha": "^2.1.0", | ||
@@ -45,0 +44,0 @@ "proxyquire": "^1.3.1", |
@@ -11,2 +11,3 @@ module.exports = transform; | ||
} | ||
opts.inputSourceMap = opts.inputSourceMap || null; | ||
var ast = recast.parse(src, opts); | ||
@@ -13,0 +14,0 @@ insertVariableInjections(ast); |
@@ -10,3 +10,3 @@ module.exports = createInjector(); | ||
var needsInjection = require('./needsInjection').create(regexp, logger); | ||
var buildInjection = require('./buildInjection'); | ||
var buildInjection = require('./buildNgInjectHandler'); | ||
var collectVariableIds = require('./collectVariableIds'); | ||
@@ -13,0 +13,0 @@ |
@@ -0,4 +1,5 @@ | ||
var hasAnnotation = require('../utils/hasAnnotation'); | ||
module.exports = create(); | ||
module.exports.create = create; | ||
var types = require('ast-types'); | ||
@@ -12,4 +13,6 @@ var n = types.namedTypes; | ||
logger = logger || require('./../silent-logger'); | ||
logger = logger || require('../silent-logger'); | ||
var containsNgInjectAnnotation = hasAnnotation(regexp); | ||
return getsInjection; | ||
@@ -35,28 +38,13 @@ | ||
function containsNgInjectAnnotation(node){ | ||
if(node.leadingComments){ // esprima ast with `options.attachComments == true` | ||
return node.leadingComments.some(isNgInjectAnnotation); | ||
} else if (node.comments) { | ||
return node.comments.some(function(comment){ //recast style ast | ||
return comment.leading && isNgInjectAnnotation(comment); | ||
}); | ||
} | ||
return false; | ||
} | ||
function isNgInjectAnnotation(comment){ | ||
return regexp.test(comment.value); | ||
} | ||
function hasInit(node){ | ||
n.VariableDeclaration.assert(node); | ||
var hasInit = false; | ||
var found = false; | ||
types.visit(node,{ | ||
visitVariableDeclarator:function(path){ | ||
if(path.node.init !== null) hasInit = true; | ||
if(path.node.init !== null) found = true; | ||
return false; | ||
} | ||
}); | ||
return hasInit; | ||
return found; | ||
} | ||
} |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Major refactor
Supply chain riskPackage has recently undergone a major refactor. It may be unstable or indicate significant internal changes. Use caution when updating to versions that include significant changes.
Found 1 instance in 1 package
Environment variable access
Supply chain riskPackage accesses environment variables, which may be a sign of credential stuffing or data theft.
Found 1 instance in 1 package
Filesystem access
Supply chain riskAccesses the file system, and could potentially read sensitive data.
Found 1 instance in 1 package
2
0
14363
10
21
415
1
- Removedmerge@^1.2.0
- Removedsource-map@^0.4.0
- Removedthrough2@^0.6.3
- Removedtransformify@^0.1.2
- Removedamdefine@1.0.1(transitive)
- Removedcore-util-is@1.0.3(transitive)
- Removedinherits@2.0.4(transitive)
- Removedisarray@0.0.1(transitive)
- Removedmerge@1.2.1(transitive)
- Removedreadable-stream@1.0.341.1.14(transitive)
- Removedsource-map@0.4.4(transitive)
- Removedstring_decoder@0.10.31(transitive)
- Removedthrough2@0.6.5(transitive)
- Removedtransformify@0.1.2(transitive)
- Removedxtend@4.0.2(transitive)