How to use the optionalUuid function from assert-plus

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

466
467
468
469
470
471
472
473
474
475
476
 *          provisioned on. Optional.
 * @param {Function} cb of the form `function (err, config, res)`
 */
CloudApi.prototype.updateConfig = function updateConfig(opts, cb) {
    assert.object(opts, 'opts');
    assert.optionalUuid(opts.default_network, 'opts.default_network');
    assert.func(cb, 'cb');


    this._request({
        method: 'PUT',
fork icon38
star icon55
watch icon0

+ 6 other calls in file

25
26
27
28
29
30
31
32
33
34
35
36


function CreateInstanceProcedure(opts) {
    assert.string(opts.svcName, 'opts.svcName');
    assert.arrayOfString(opts.serverNames, 'opts.serverNames');
    assert.ok(opts.serverNames.length > 0, 'at least one server name');
    assert.optionalUuid(opts.imageUuid, 'opts.imageUuid');
    assert.optionalString(opts.imageChannel, 'opts.imageChannel');
    assert.optionalBool(opts.skipHACheck, 'opts.skipHACheck');


    this.svcName = opts.svcName;
fork icon19
star icon13
watch icon0

49
50
51
52
53
54
55
56
57
58
assert.optionalBool(ctx.app.options.userMigrationAllowed,
    'ctx.app.options.userMigrationAllowed');
assert.optionalObject(ctx.migrationRecord, 'ctx.migrationRecord');
assert.object(ctx.req, 'ctx.req');
assert.func(callback, 'callback');
assert.optionalUuid(ctx.ownerUuid, 'ctx.ownerUuid');

var checkUuidProps = ['override_server_uuid', 'override_uuid'];
var i;
var p;
fork icon20
star icon11
watch icon0

267
268
269
270
271
272
273
274
275
276
    options = undefined;
}

assert.object(params, 'params');
assert.uuid(params.uuid, 'params.uuid');
assert.optionalUuid(params.owner_uuid, 'params.owner_uuid');
assert.optionalObject(options, 'options');
assert.func(callback, 'callback');

if (params.owner_uuid) {
fork icon13
star icon2
watch icon0

+ 3 other calls in file

168
169
170
171
172
173
174
175
176
177
tt.test(' delete volumes', function (t) {
    var delVolsParams = {
        uuid: TEST_VOLUME_UUID
    };

    assert.optionalUuid(TEST_VOLUME_UUID, 'TEST_VOLUME_UUID');
    if (!TEST_VOLUME_UUID) {
        t.end();
        return;
    }
fork icon13
star icon2
watch icon0

663
664
665
666
667
668
669
670
671
672
673
 * @param {Function} callback of the form fn(err, user).
 * @throws {TypeError} on bad input.
 */
UFDS.prototype.addUser = function addUser(user, cb) {
    assert.object(user, 'user');
    assert.optionalUuid(user.account, 'user.account must be a uuid');
    assert.func(cb, 'callback');


    cb = once(cb);

fork icon9
star icon3
watch icon0

+ 3 other calls in file

136
137
138
139
140
141
142
143
144
145
146
 *       all: true
 *     }
 *   }
 */
VMCache.prototype.addTags = function addTags(owner, tags) {
    assert.optionalUuid(owner, 'owner');
    assert.optionalObject(tags, 'tags');


    if (!tags || prim.isEmpty(tags)) {
        return;
fork icon6
star icon1
watch icon0

+ 3 other calls in file

231
232
233
234
235
236
237
238
239
self.log.trace({
    req_id: req_id,
    payload: payload
}, 'creating VM');

assert.optionalUuid(payload.uuid, 'payload.uuid');
if (!payload.hasOwnProperty('uuid')) {
    payload.uuid = uuidv4();
}
fork icon3
star icon3
watch icon0

286
287
288
289
290
291
292
293
294
295
var proto = {};

assert.uuid(obj.spanId, 'obj.spanId');
assert.uuid(obj.traceId, 'obj.traceId');
if (obj.parentSpanId !== '0') {
    assert.optionalUuid(obj.parentSpanId, 'obj.parentSpanId');
}
assert.string(obj.operation, 'obj.operation');

id = obj.spanId;
fork icon2
star icon1
watch icon0