blob: 04fd3ba78146d95fb3b8ef694d30271ada59fe4a [file] [log] [blame]
var wrappy = require('wrappy')
module.exports = wrappy(dezalgo)
var asap = require('asap')
function dezalgo (cb) {
var sync = true
asap(function () {
sync = false
})
return function zalgoSafe() {
var args = arguments
var me = this
if (sync)
asap(function() {
cb.apply(me, args)
})
else
cb.apply(me, args)
}
}