Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
var la = require('lazy-ass')
var check = require('check-more-types')
var log = require('debug')('next-update')
const R = require('ramda')
var request = require('request')
var verify = check.verify
var semver = require('semver')
var q = require('q')
var localVersion = require('./local-module-version')
var isUrl = require('npm-utils').isUrl
var _ = require('lodash')
const {isPrerelease} = require('./utils')
var _registryUrl = require('npm-utils').registryUrl
la(check.fn(_registryUrl), 'expected registry url function')
var registryUrl = _.once(_registryUrl)
const notPrerelease = R.complement(isPrerelease)
function cleanVersion (version, name) {
var originalVersion = version
verify.unemptyString(version, 'missing version string' + version)
verify.unemptyString(name, 'missing name string' + name)
if (isUrl(version)) {
// version = version.substr(version.indexOf('#') + 1);
// hmm, because we don't have a way to fetch git tags yet
// just skip these dependencies
console.log('Cannot handle git repos, skipping', name, 'at', version)
return
function makeRegistry (find, options) {
la(is.fn(find), 'missing find package function')
const express = require('express')
const morgan = require('morgan')
const app = express()
function getTarball (req, res) {
console.log('tarball for %s@%s', req.params.name, req.params.version)
const found = find(req.params.name)
if (!found) {
return res.status(404).send({})
}
// console.log('found package')
// console.log(found)
it('is a single function', function () {
la(check.fn(stamp));
});
it('is a function', () => {
la(is.fn(gitRemoteToHttps))
})
it('is a function', () => {
la(is.fn(getUsername))
})
if (msgPattern) {
checkMessageAgainstPattern(msg, msgPattern);
}
const wizard = preGit.wizard();
if (!wizard) {
log('no commit message wizard defined');
process.exit(0);
}
log('found commit message wizard with name', wizard.name);
la(check.fn(wizard.validate),
'missing wizard validate method,', Object.keys(wizard));
la(check.fn(preGit.printError),
'missing preGit.printError,', Object.keys(preGit));
log('checking commit message:', msg);
const isValid = wizard.validate(msg);
if (!isValid) {
log('invalid commit message', msg);
process.exit(-1);
}
log('valid git commit message');
}
it('is a function', () => {
la(check.fn(parse))
})
'use strict'
var la = require('lazy-ass')
var is = require('check-more-types')
var run = require('./npm-test')
var debug = require('debug')('npm-utils')
var q = require('q')
la(is.fn(run), 'expected function')
function publish (options) {
options = options || {}
var command = 'npm publish'
if (is.unemptyString(options.tag)) {
debug('publishing with a tag', options.tag)
command += ' --tag ' + options.tag
}
if (is.unemptyString(options.access)) {
debug('publishing with specific access', options.access)
command += ' --access ' + options.access
}
return run(command)
.catch(function (info) {
function pickFunction(validator) {
const isValid = check.fn(validator) ? validator : validator.validateMessage;
la(check.fn(isValid), 'validator is not a function', isValid);
return isValid;
}
function isValidMessage(message) {
if (!wizard) {
return message;
}
la(check.unemptyString(message), 'missing message');
const first = firstLine(message);
if (!check.unemptyString(first)) {
return Promise.reject(new Error('missing first line'));
}
if (check.fn(wizard.validate)) {
if (!wizard.validate(message)) {
return Promise.reject(new Error('Invalid commit message\n' + message));
}
}
return message;
}