How to use the finite function from assert-plus

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

534
535
536
537
538
539
540
541
542
543
 *
 * Throws TypeError's if you pass bad arguments.
 */
function MantaClient(options) {
    assert.object(options, 'options');
    assert.finite(options.connectTimeout, 'options.connectTimeout');
    assert.optionalObject(options.headers, 'options.headers');
    assert.object(options.log, 'options.log');
    assert.optionalString(options.url, 'options.url');
    assert.optionalString(options.socketPath, 'options.socketPath');
fork icon41
star icon75
watch icon0

62
63
64
65
66
67
68
69
70
71
72
73




function addInputsFromStdin(client, opts, cb) {
    assert.object(client, 'client');
    assert.object(opts, 'options');
    assert.finite(opts.batch, 'options.batch');
    assert.arrayOfString(opts.jobIds, 'options.jobIds');
    assert.finite(opts.parallel, 'options.parallel');
    assert.optionalBool(opts.open, 'options.open');
    assert.func(cb, 'callback');
fork icon41
star icon75
watch icon0

+ 5 other calls in file

179
180
181
182
183
184
185
186
187
188
189


/*
 * Set a timeout for queries ("queryTimeout" in the configuration).
 */
PGClient.prototype.setTimeout = function setQueryTimeout(timeout) {
    assert.finite(timeout, 'timeout');
    assert.ok(timeout >= 0, 'timeout >= 0');
    this._queryTimeout = timeout;
};

fork icon21
star icon60
watch icon0

741
742
743
744
745
746
747
748
749
750
751
// Wait for the given account to be "ready". Here "ready" means that we get
// a successful response from `HEAD /:login/stor`.
function _waitForAccountToBeReady(t, opts, cb) {
    assert.object(t, 't');
    assert.object(opts.accountInfo, 'opts.accountInfo');
    assert.finite(opts.timeout, 'opts.timeout'); // number of seconds


    var client = mantaClientFromAccountInfo(opts.accountInfo);
    var lastErr = true; // `true` to force first `pingAttempt`
    var start = Date.now();
fork icon16
star icon13
watch icon34