https://project.mdnd-it.cc/work_packages/94
This commit is contained in:
2025-08-23 04:25:28 +02:00
parent 725516ad6c
commit 19cfa031d0
25823 changed files with 1095587 additions and 2801760 deletions
+18
View File
@@ -0,0 +1,18 @@
"use strict"
var next = require('./next.js')
module.exports = function maybe (cb, promise) {
if (cb) {
promise
.then(function (result) {
next(function () { cb(null, result) })
}, function (err) {
next(function () { cb(err) })
})
return undefined
}
else {
return promise
}
}
+15
View File
@@ -0,0 +1,15 @@
'use strict'
function makeNext () {
if (typeof process === 'object' && typeof process.nextTick === 'function') {
return process.nextTick
} else if (typeof setImmediate === 'function') {
return setImmediate
} else {
return function next (f) {
setTimeout(f, 0)
}
}
}
module.exports = makeNext()