Comparing version 1.8.2-alpha1 to 1.8.2
@@ -36,3 +36,14 @@ module.exports = snyk; | ||
snyk.id = require('./config').id; | ||
snyk.api = require('./api-key')(); | ||
var apikey = require('./api-key'); | ||
// make snyk.api *always* get the latest api key from the config store | ||
Object.defineProperty(snyk, 'api', { | ||
enumerable: true, | ||
configurable: true, | ||
get: function () { | ||
return apikey(); | ||
}, | ||
}); | ||
snyk.modules = require('./modules'); | ||
@@ -39,0 +50,0 @@ snyk.test = require('./test'); |
@@ -520,10 +520,9 @@ var protect = module.exports = { | ||
function generatePolicy(policy, tasks, live) { | ||
var promises = ['ignore', 'update', 'patch'].filter(function (task) { | ||
return tasks[task].length; | ||
}).map(function (task) { | ||
return protect[task](tasks[task], live); | ||
}); | ||
var promises = [ | ||
protect.ignore(tasks.ignore, live), | ||
protect.update(tasks.update, live), | ||
protect.patch(tasks.patch, live), | ||
log(tasks, live), | ||
]; | ||
promises.push(log(tasks, live)); | ||
return Promise.all(promises).then(function (res) { | ||
@@ -530,0 +529,0 @@ // we're squashing the arrays of arrays into a flat structure |
@@ -6,2 +6,3 @@ module.exports = test; | ||
var request = require('./request'); | ||
var path = require('path'); | ||
var fs = require('then-fs'); | ||
@@ -48,2 +49,6 @@ var protect = require('./protect'); | ||
p = snyk.modules(root, options).then(function (pkg) { | ||
// if there's no package name, let's get it from the root dir | ||
if (!pkg.name) { | ||
pkg.name = path.basename(path.resolve(root)); | ||
} | ||
analytics.add('package', pkg.name + '@' + pkg.version); | ||
@@ -50,0 +55,0 @@ policyLocations = policyLocations.concat(pluckPolicies(pkg)); |
@@ -5,3 +5,2 @@ { | ||
"main": "lib/index.js", | ||
"version": "1.8.2-alpha1", | ||
"directories": { | ||
@@ -64,3 +63,4 @@ "test": "test" | ||
"url": "https://github.com/Snyk/snyk.git" | ||
} | ||
} | ||
}, | ||
"version": "1.8.2" | ||
} |
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
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 v1
QualityPackage is not semver >=1. This means it is not stable and does not support ^ ranges.
Found 1 instance in 1 package
1
4064434
85
3786