mirror of
https://github.com/biobulkbende/biobulkbende.org.git
synced 2025-10-11 23:25:00 +00:00
structure, layout and automation
This commit is contained in:
3
node_modules/timers-ext/promise/.eslintrc.json
generated
vendored
Normal file
3
node_modules/timers-ext/promise/.eslintrc.json
generated
vendored
Normal file
@ -0,0 +1,3 @@
|
||||
{
|
||||
"globals": { "Promise": true }
|
||||
}
|
21
node_modules/timers-ext/promise/sleep.js
generated
vendored
Normal file
21
node_modules/timers-ext/promise/sleep.js
generated
vendored
Normal file
@ -0,0 +1,21 @@
|
||||
"use strict";
|
||||
|
||||
var isValue = require("es5-ext/object/is-value")
|
||||
, isPromise = require("es5-ext/object/is-promise")
|
||||
, nextTick = require("next-tick")
|
||||
, ensureTimeout = require("../valid-timeout");
|
||||
|
||||
module.exports = function (/* timeout */) {
|
||||
var Constructor = isPromise(this) ? this.constructor : Promise;
|
||||
var timeout = arguments[0];
|
||||
if (isValue(timeout)) timeout = ensureTimeout(timeout);
|
||||
return new Constructor(function (resolve) {
|
||||
if (isValue(timeout)) {
|
||||
setTimeout(function () {
|
||||
resolve();
|
||||
}, timeout);
|
||||
} else {
|
||||
nextTick(resolve);
|
||||
}
|
||||
});
|
||||
};
|
Reference in New Issue
Block a user