rewrite delay to not node-only version (#3820)

This commit is contained in:
maximelkin 2020-04-25 00:52:00 +03:00 committed by GitHub
parent ec9c61a114
commit 93f3f0ed11
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -1,3 +1,6 @@
const { promisify } = require('util');
module.exports = promisify(setTimeout);
/**
* @param {number} delay
* @returns {Promise<void>}
*/
module.exports = (delay) =>
new Promise((resolve) => setTimeout(resolve, delay));