How to use the arrayOfNumber function from assert-plus
Find comprehensive JavaScript assert-plus.arrayOfNumber code examples handpicked from public code repositorys.
1200 1201 1202 1203 1204 1205 1206 1207 1208 1209 1210
* @param {arrayOfNumber} relativeTo: an array representing the starting time as * returned by `process.hrtime()` from which to compute the * time difference. */ function monotonicTimeDiffMs(relativeTo) { assert.arrayOfNumber(relativeTo, 'relativeTo'); var diff = process.hrtime(relativeTo); var ms = (diff[0] * 1e3) + (diff[1] / 1e6); // in milliseconds return ms;
115 116 117 118 119 120 121 122 123 124 125 126
} util.inherits(ValidationError, restify.RestError); function VolumeSizeNotAvailableError(size, availableSizes) { assert.number(size, 'size'); assert.arrayOfNumber(availableSizes, 'availableSizes'); var message = 'Volume size ' + size + ' is not available. Available ' + 'sizes are: ' + availableSizes.join(', ');
74 75 76 77 78 79 80 81 82 83 84 85 86
doCreateVolume(this, params, options, callback); }; function hrtimeToMs(hrtime) { assert.arrayOfNumber(hrtime, 'hrtime'); assert.ok(hrtime.length === 2, 'hrtime must be an array of length 2'); var MSECS_PER_SEC = 1000; var NSECS_PER_MSEC = 1e6;
assert-plus.object is the most popular function in assert-plus (2295 examples)