Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
function elaborateIssue(issue) {
let progress = log.newItem('LEWG' + issue.id + ': ' + issue.summary, 3);
function completeWork(x) {
progress.completeWork(1);
return x;
}
let commentsP = isocppIssues.getComments(issue.id).then(completeWork);
let ccNamesP = isocppIssues.getUserRealNames(issue.cc.filter(addr => {
// Don't mention the LEWG chair as someone to invite.
return !addr.startsWith('jyasskin@') &&
!addr.startsWith('titus@') &&
// And don't list the presenter separately.
addr != issue.assigned_to;
}));
ccNamesP = ccNamesP.then(completeWork);
let presenterNameP;
if (issue.assigned_to === 'lib-ext@lists.isocpp.org') {
presenterNameP = Promise.resolve(undefined);
.on('response', function(response) {
var length = parseInt(response.headers['content-length'], 10);
var progress = log.newItem('', length);
if (successful(response)) {
response.pipe(fs.createWriteStream(dest));
}
// The `progress` is true by default. However if it has not
// been explicitly set it's `undefined` which is considered
// as far as npm is concerned.
if (process.env.npm_config_progress === 'true') {
log.enableProgress();
response.on('data', function(chunk) {
progress.completeWork(chunk.length);
})
.on('end', progress.finish);
}
}).on("response", function(response) {
var length = parseInt(response.headers["content-length"], 10);
var progress = log.newItem("", length);
// The `progress` is true by default. However if it has not
// been explicitly set it's `undefined` which is considered
// as far as npm is concerned.
if (process.env.npm_config_progress === "true") {
log.enableProgress();
response
.on("data", function(chunk) {
progress.completeWork(chunk.length);
})
.on("end", progress.finish);
}
});
} catch (err) {
.on('response', function(response) {
var length = parseInt(response.headers['content-length'], 10);
var progress = log.newItem('', length);
if (successful(response)) {
response.pipe(fs.createWriteStream(dest));
}
// The `progress` is true by default. However if it has not
// been explicitly set it's `undefined` which is considered
// as far as npm is concerned.
if (process.env.npm_config_progress === 'true') {
log.enableProgress();
response.on('data', function(chunk) {
progress.completeWork(chunk.length);
})
.on('end', progress.finish);
}
function getLatestNpmVersion (cb) {
var tracker = log.newItem('getLatestNpmVersion', 1)
tracker.info('getLatestNpmVersion', 'Getting npm package information')
fetchPackageMetadata('npm@latest', '.', {}, function (err, d) {
tracker.finish()
if (err) { return cb(err) }
cb(null, d.version)
})
}
function getGitPath (cb) {
var tracker = log.newItem('getGitPath', 1)
tracker.info('getGitPath', 'Finding git in your PATH')
which('git', function (err, path) {
tracker.finish()
cb(err, path)
})
}
getUid(npm.config.get('user'), npm.config.get('group'), function (e, uid, gid) {
var tracker = log.newItem('checkFilePermissions', 1)
if (e) {
tracker.finish()
tracker.warn('checkFilePermissions', 'Error looking up user and group:', e)
return cb(e)
}
tracker.info('checkFilePermissions', 'Building file list of ' + root)
fileCompletion(root, '.', Infinity, function (e, files) {
if (e) {
tracker.warn('checkFilePermissions', 'Error building file list:', e)
tracker.finish()
return cb(e)
}
tracker.addWork(files.length)
tracker.completeWork(1)
chain(files.map(andCheckFile), function (er) {
tracker.finish()
function rm (args) {
if (args.length === 0) {
throw new Error('npm token revoke ')
}
const conf = config()
const toRemove = []
const progress = log.newItem('removing tokens', toRemove.length)
progress.info('token', 'getting existing list')
return pulseTillDone.withPromise(profile.listTokens(conf).then((tokens) => {
args.forEach((id) => {
const matches = tokens.filter((token) => token.key.indexOf(id) === 0)
if (matches.length === 1) {
toRemove.push(matches[0].key)
} else if (matches.length > 1) {
throw new Error(`Token ID "${id}" was ambiguous, a new token may have been created since you last ran \`npm-profile token list\`.`)
} else {
const tokenMatches = tokens.filter((token) => id.indexOf(token.token) === 0)
if (tokenMatches === 0) {
throw new Error(`Unknown token id or value "${id}".`)
}
toRemove.push(id)
}
})