New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

ng-test-utils

Package Overview
Dependencies
Maintainers
1
Versions
19
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

ng-test-utils - npm Package Compare versions

Comparing version 0.0.1 to 0.0.2

index.js

13

package.json
{
"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

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