qauMaWeb/node_modules/@hapi/hoek/lib/wait.js

14 lines
302 B
JavaScript

'use strict';
const internals = {};
module.exports = function (timeout, returnValue) {
if (typeof timeout !== 'number' && timeout !== undefined) {
throw new TypeError('Timeout must be a number');
}
return new Promise((resolve) => setTimeout(resolve, timeout, returnValue));
};