Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
function parseConstructorArguments(args) {
let options, sprintf_args, shortmessage, k;
assert.object(args, 'args');
assert.bool(args.strict, 'args.strict');
assert.array(args.argv, 'args.argv');
assert.optionalBool(args.skipPrintf, 'args.skipPrintf');
const argv = args.argv;
/*
* First, figure out which form of invocation we've been given.
*/
if (argv.length === 0) {
options = {};
sprintf_args = [];
} else if (_.isError(argv[0])) {
options = { cause: argv[0] };
sprintf_args = argv.slice(1);
} else if (typeof argv[0] === 'object') {
options = {};
// eslint-disable-next-line guard-for-in
for (k in argv[0]) {
import * as assert from 'assert-plus';
const arr = ['one', 'two'];
assert.array(arr, '');
function compileQuery(b, f, args) {
assert.object(b, 'bucket');
assert.string(b.name, 'bucket.name');
assert.object(b.index, 'bucket.index');
assert.bool(b.hasExtendedId, 'b.hasExtendedId');
assert.object(f, 'query');
assert.array(args, 'args');
var clause = '';
var i;
var v;
function _mapOp(direction) {
var ltype, rtype, op;
if (!jsprim.hasKey(b.index, f.attribute)) {
throw new NotIndexedError(b.name, f.toString());
}
ltype = b.index[f.attribute].type;
if (!jsprim.hasKey(TYPES, ltype)) {
throw new InvalidQueryError(f.toString());
}
function MultiError(errors)
{
mod_assertplus.array(errors, 'list of errors');
mod_assertplus.ok(errors.length > 0, 'must be at least one error');
this.ase_errors = errors;
VError.call(this, {
'cause': errors[0]
}, 'first of %d error%s', errors.length, errors.length == 1 ? '' : 's');
}
function MultiError(errors)
{
mod_assertplus.array(errors, 'list of errors');
mod_assertplus.ok(errors.length > 0, 'must be at least one error');
this.ase_errors = errors;
VError.call(this, {
'cause': errors[0]
}, 'first of %d error%s', errors.length, errors.length == 1 ? '' : 's');
}
function filterGetNetworksOrPools(opts, networks) {
assert.object(opts, 'opts');
assert.object(opts.account, 'opts.account');
assert.array(networks, 'networks');
this.hooks.filterGetNetworksOrPools.forEach(function runPlugin(plugin) {
networks = plugin(opts, networks);
});
return networks;
};
function parseConstructorArguments(args)
{
var argv, options, sprintf_args, shortmessage, k;
mod_assertplus.object(args, 'args');
mod_assertplus.bool(args.strict, 'args.strict');
mod_assertplus.array(args.argv, 'args.argv');
argv = args.argv;
/*
* First, figure out which form of invocation we've been given.
*/
if (argv.length === 0) {
options = {};
sprintf_args = [];
} else if (mod_isError(argv[0])) {
options = { 'cause': argv[0] };
sprintf_args = argv.slice(1);
} else if (typeof (argv[0]) === 'object') {
options = {};
for (k in argv[0]) {
options[k] = argv[0][k];
}
function MultiError(errors)
{
mod_assertplus.array(errors, 'list of errors');
mod_assertplus.ok(errors.length > 0, 'must be at least one error');
this.ase_errors = errors;
VError.call(this, {
'cause': errors[0]
}, 'first of %d error%s', errors.length, errors.length == 1 ? '' : 's');
}
function MultiError(errors) {
assert.array(errors, 'list of errors');
assert.ok(errors.length > 0, 'must be at least one error');
this.ase_errors = errors;
VError.call(
this,
{
cause: errors[0]
},
'first of %d error%s',
errors.length,
errors.length === 1 ? '' : 's'
);
}
function parseConstructorArguments(args)
{
var argv, options, sprintf_args, shortmessage, k;
mod_assertplus.object(args, 'args');
mod_assertplus.bool(args.strict, 'args.strict');
mod_assertplus.array(args.argv, 'args.argv');
argv = args.argv;
/*
* First, figure out which form of invocation we've been given.
*/
if (argv.length === 0) {
options = {};
sprintf_args = [];
} else if (mod_isError(argv[0])) {
options = { 'cause': argv[0] };
sprintf_args = argv.slice(1);
} else if (typeof (argv[0]) === 'object') {
options = {};
for (k in argv[0]) {
options[k] = argv[0][k];
}