Initial commit

This commit is contained in:
2025-03-07 19:22:02 +01:00
commit 4a98255d83
55743 changed files with 5280367 additions and 0 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()