How to use the optionalArrayOfUuid function from assert-plus

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

1083
1084
1085
1086
1087
1088
1089
1090
1091
1092
assert.string(opts.name, 'opts.name');
assert.string(opts.version, 'opts.version');
assert.optionalString(opts.description, 'opts.description');
assert.optionalString(opts.homepage, 'opts.homepage');
assert.optionalString(opts.eula, 'opts.eula');
assert.optionalArrayOfUuid(opts.acl, 'opts.acl');
assert.optionalObject(opts.tags, 'opts.tags');
assert.func(cb, 'cb');

this._request({
fork icon38
star icon55
watch icon0

+ 13 other calls in file

42
43
44
45
46
47
48
49
50
51
func: function validateOneNetwork(networkUuid, cb) {
    napiClient.getNetwork(networkUuid, function onGetNetwork(err, net) {
        if (!err && net) {
            assert.object(net, 'net');
            assert.optionalBool(net.fabric, 'net.fabric');
            assert.optionalArrayOfUuid(net.owner_uuids,
                'net.owner_uuids');

            if (net.fabric !== true) {
                nonFabric.push(networkUuid);
fork icon6
star icon8
watch icon0

+ 3 other calls in file

659
660
661
662
663
664
665
666
667
668
    return;
}

volumeObjects.forEach(function processVolumeObj(volumeObj) {
    var volumeRefs = volumeObj.value.refs;
    mod_assert.optionalArrayOfUuid(volumeRefs,
        'volumeRefs');

    if (!volumeRefs || volumeRefs.length === 0) {
        return;
fork icon6
star icon8
watch icon0

+ 5 other calls in file

11
12
13
14
15
16
17
18
19
20
21
22
var restify = require('restify');
var util = require('util');


function InvalidNetworksError(options) {
    assert.object(options, 'options');
    assert.optionalArrayOfUuid(options.missing, 'options.missing');
    assert.optionalArrayOfUuid(options.nonOwned, 'options.nonOwned');
    assert.optionalArrayOfUuid(options.nonFabric, 'options.nonFabric');


    assert.ok((options.missing && options.missing.length > 0) ||
fork icon6
star icon8
watch icon0

+ 5 other calls in file

183
184
185
186
187
188
189
190
191
192
193
 *     "<VM 2 UUID>": 1
 *   }
 */
VMCache.prototype.addVMs = function addVMs(owner, vms) {
    assert.optionalUuid(owner, 'owner');
    assert.optionalArrayOfUuid(vms, 'vms');


    if (!vms || vms.length === 0) {
        return;
    }
fork icon6
star icon1
watch icon0