How to use the bool function from assert-plus

Find comprehensive JavaScript assert-plus.bool code examples handpicked from public code repositorys.

557
558
559
560
561
562
563
564
565
566
567
 */
CloudApi.prototype.updateNetworkIp = function updateNetworkIp(opts, cb) {
    assert.object(opts, 'opts');
    assert.uuid(opts.id, 'opts.id');
    assert.string(opts.ip, 'opts.ip');
    assert.bool(opts.reserved, 'opts.reserved');
    assert.func(cb, 'cb');


    var endpoint = this._path(format('/%s/networks/%s/ips/%s',
        this.account, opts.id, opts.ip));
fork icon38
star icon55
watch icon0

+ 20 other calls in file

557
558
559
560
561
562
563
564
565
566
567
568
}


function _ensureAccount(opts, cb) {
    assert.object(opts.t, 'opts.t');
    assert.object(opts.ufdsClient, 'opts.ufdsClient');
    assert.bool(opts.isOperator, 'opts.isOperator');
    assert.string(opts.loginPrefix, 'opts.loginPrefix');
    assert.string(opts.cacheDir, 'opts.cacheDir');


    var t = opts.t;
fork icon16
star icon13
watch icon34

1265
1266
1267
1268
1269
1270
1271
1272
1273

        done();
    });
},
function markVolumeAsDeleted(ctx, done) {
    assert.bool(ctx.storageVmNeedsDeletion,
        'ctx.storageVmNeedsDeletion');

    var volumeObject = req.loadedVolumeObject;
fork icon6
star icon8
watch icon0

+ 5 other calls in file

1388
1389
1390
1391
1392
1393
1394
1395
1396
1397
var nbadprobegroup = 0;

assertplus.object(args, 'args');
assertplus.object(args.stream, 'args.stream');
assertplus.optionalArrayOfString(args.columns, 'args.columns');
assertplus.bool(args.omitHeader, 'args.omitHeader');

assertplus.notStrictEqual(
    this.ma_amon_deployed,
    null,
fork icon13
star icon7
watch icon42

+ 8 other calls in file

173
174
175
176
177
178
179
180
181
182
    };
    self.updateUser(user, mod, cb);
};

user.setDisabled = function setDisabled(value, cb) {
    assert.bool(value);
    if (user.account) {
        return cb(new Error('not valid for user-users'));
    }
    var mod = {
fork icon9
star icon3
watch icon0

502
503
504
505
506
507
508
509
510
511
assert.object(sourceInfo, 'sourceInfo');
assert.string(sourceInfo.url, 'sourceInfo.url');
assert.string(sourceInfo.type, 'sourceInfo.type');
assert.optionalString(sourceInfo.channel, 'sourceInfo.channel');
assert.optionalBool(sourceInfo.insecure, 'sourceInfo.secure');
assert.bool(skipPingCheck, 'skipPingCheck');
assert.func(callback, 'callback');
var self = this;

// No-op if already have this URL/TYPE/INSECURE.
fork icon248
star icon0
watch icon0

+ 5 other calls in file

71
72
73
74
75
76
77
78
79
80
assert.ok(CHANNEL_NAME_RE.test(chan.name),
    format('invalid channel name: %j, must match %s',
        chan.name, CHANNEL_NAME_RE));
assert.string(chan.description, 'config.channels['+i+'].description');
if (chan.hasOwnProperty('default')) {
    assert.bool(chan.default, 'config.channels['+i+'].default');
    if (defaultChannel) {
        assert.ok(false,
            format('cannot have multiple *default* channels: %j and %j',
                defaultChannel, chan));
fork icon17
star icon5
watch icon0

971
972
973
974
975
976
977
978
979
980
 *        default is specified in the option type usage.
 */
function addOptionType(optionType) {
    assert.object(optionType, 'optionType');
    assert.string(optionType.name, 'optionType.name');
    assert.bool(optionType.takesArg, 'optionType.takesArg');
    if (optionType.takesArg) {
        assert.string(optionType.helpArg, 'optionType.helpArg');
    }
    assert.func(optionType.parseArg, 'optionType.parseArg');
fork icon0
star icon0
watch icon1

+ 9 other calls in file