"Fossies" - the Fresh Open Source Software Archive

Member "Atom/resources/app/apm/node_modules/dezalgo/dezalgo.js" (8 Mar 2017, 368 Bytes) of archive /windows/misc/atom-windows.zip:


As a special service "Fossies" has tried to format the requested source page into HTML format using (guessed) Javascript source code syntax highlighting (style: standard) with prefixed line numbers and code folding option. Alternatively you can here view or download the uninterpreted source code file.

    1 var wrappy = require('wrappy')
    2 module.exports = wrappy(dezalgo)
    3 
    4 var asap = require('asap')
    5 
    6 function dezalgo (cb) {
    7   var sync = true
    8   asap(function () {
    9     sync = false
   10   })
   11 
   12   return function zalgoSafe() {
   13     var args = arguments
   14     var me = this
   15     if (sync)
   16       asap(function() {
   17         cb.apply(me, args)
   18       })
   19     else
   20       cb.apply(me, args)
   21   }
   22 }