This commit is contained in:
parent
7a9bf3199a
commit
c294e2e9ae
5702 changed files with 465039 additions and 34 deletions
22
node_modules/dezalgo/dezalgo.js
generated
vendored
Normal file
22
node_modules/dezalgo/dezalgo.js
generated
vendored
Normal file
|
|
@ -0,0 +1,22 @@
|
|||
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)
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue