Files
lsp/node_modules/@hapi/hoek/lib/wait.js
Arnaud Nelissen 3af7ddab06 Initial commit
2021-11-17 11:25:08 +01:00

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));
};