How to use the optionalFinite function from assert-plus

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

1851
1852
1853
1854
1855
1856
1857
1858
1859
if (typeof (opts) === 'function') {
    cb = opts;
    opts = {};
}
assert.object(opts, 'options');
assert.optionalFinite(opts.size, 'options.size');
assert.func(cb, 'callback');

input.pause();
fork icon41
star icon75
watch icon0

+ 7 other calls in file

1106
1107
1108
1109
1110
1111
1112
1113
1114
1115
1116
// Return the MPU upload path for a given upload ID.
// Optionally also append a part number, if given.
function mpuUploadPath(accountLogin, uploadId, partNum) {
    assert.string(accountLogin, 'accountLogin');
    assert.uuid(uploadId, 'uploadId');
    assert.optionalFinite(partNum, 'partNum');


    var c;
    var len;
    var p;
fork icon16
star icon13
watch icon34

113
114
115
116
117
118
119
120
121
122
if (options.headers === undefined) {
  options.headers = [request.headers['x-date'] ? 'x-date' : 'date'];
}
assert.object(options, 'options');
assert.arrayOfString(options.headers, 'options.headers');
assert.optionalFinite(options.clockSkew, 'options.clockSkew');

var authzHeaderName = options.authorizationHeaderName || 'authorization';

if (!request.headers[authzHeaderName]) {
fork icon1
star icon0
watch icon0