@jswork/next-jjencode
Version:
jjencode for next.
9 lines • 1.99 kB
JavaScript
/*!
* name: @jswork/next-jjencode
* description: jjencode for next.
* homepage: https://github.com/afeiship/next-jjencode
* version: 1.0.0
* date: 2020-11-22 13:36:13
* license: MIT
*/
!function(){var $=(this||window||Function("return this")()).nx||require("@jswork/next");$.jjencode=function(_,$,e){for(var r,e=e||!1,n="",t=["___","__$","_$_","_$$","$__","$_$","$$_","$$$","$___","$__$","$_$_","$_$$","$$__","$$_$","$$$_","$$$$"],o="",i=0;i<$.length;i++)34==(r=$.charCodeAt(i))||92==r?o+="\\\\\\"+$.charAt(i).toString(16):33<=r&&r<=47||58<=r&&r<=64||91<=r&&r<=96||123<=r&&r<=127?o+=$.charAt(i):o=(48<=r&&r<=57||97<=r&&r<=102?(o&&(n+='"'+o+'"+'),n+=_+"."+t[r<64?r-48:r-87]+"+"):108==r?(o&&(n+='"'+o+'"+'),n+='(![]+"")['+_+"._$_]+"):111==r?(o&&(n+='"'+o+'"+'),n+=_+"._$+"):116==r?(o&&(n+='"'+o+'"+'),n+=_+".__+"):117==r?(o&&(n+='"'+o+'"+'),n+=_+"._+"):r<128?(n+=o?'"'+o:'"',n+='\\\\"+'+r.toString(8).replace(/[0-7]/g,function($){return _+"."+t[$]+"+"})):(n+=o?'"'+o:'"',n+='\\\\"+'+_+"._+"+r.toString(16).replace(/[0-9a-f]/gi,function($){return _+"."+t[parseInt($,16)]+"+"})),"");return o&&(n+='"'+o+'"+'),n=_+"=~[];"+_+"={___:++"+_+',$$$$:(![]+"")['+_+"],__$:++"+_+',$_$_:(![]+"")['+_+"],_$_:++"+_+',$_$$:({}+"")['+_+"],$$_$:("+_+"["+_+']+"")['+_+"],_$$:++"+_+',$$$_:(!""+"")['+_+"],$__:++"+_+",$_$:++"+_+',$$__:({}+"")['+_+"],$$_:++"+_+",$$$:++"+_+",$___:++"+_+",$__$:++"+_+"};"+_+".$_=("+_+".$_="+_+'+"")['+_+".$_$]+("+_+"._$="+_+".$_["+_+".__$])+("+_+".$$=("+_+'.$+"")['+_+".__$])+((!"+_+')+"")['+_+"._$$]+("+_+".__="+_+".$_["+_+".$$_])+("+_+'.$=(!""+"")['+_+".__$])+("+_+'._=(!""+"")['+_+"._$_])+"+_+".$_["+_+".$_$]+"+_+".__+"+_+"._$+"+_+".$;"+_+".$$="+_+'.$+(!""+"")['+_+"._$$]+"+_+".__+"+_+"._+"+_+".$+"+_+".$$;"+_+".$=("+_+".___)["+_+".$_]["+_+".$_];"+_+".$("+_+".$("+_+'.$$+"\\""+'+n+'"\\"")())();',e&&(n='"\'\\"+\'+",'+(n=n.replace(/[,;]$/,""))+",',"+n.split("").reverse().join("")+',"+\'+"\\\'"'),n},"undefined"!=typeof module&&module.exports&&(module.exports=$.jjencode)}();