Skip to content

Commit

Permalink
Add files via upload
Browse files Browse the repository at this point in the history
  • Loading branch information
BaseMax authored Jul 16, 2020
1 parent 55920f8 commit 761ec49
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions source/ko-engine.min.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
/*
* @Name: ko-engine
* @Author: Max Base
* @Repository: https://github.com/basemax/ko-engine
* @Date: 2020-07-16
*/
var KoEngine=function(e,n,r){for(var t,c,o=/<\?(.+?)\?>/g,u=/(^( )?(if|else|switch|case|default|break|for|{|}))(.*)?/g,i="var code=[];\n",a=function(e,n){return n?e.match(u)?i+=e+"\n":i+="code.push("+e+");\n":""!=e&&(i+='code.push("'+e.replace(/"/g,'"')+'");\n'),a},s=0;t=o.exec(e);)a(e.slice(s,t.index))(t[1],!0),s=t.index+t[0].length;if(a(e.substr(s,e.length-s)),i=(i+='return code.join("");').replace(/[\r\t\n]/g,""),n&&"object"==typeof n?c=new Function(...Object.keys(n),i)(...Object.values(n)):(c=new Function(i)(),r=n),void 0===r||!r)return c;var d=document.querySelector(r);return!!d&&(d.innerHTML=c,!0)};

0 comments on commit 761ec49

Please sign in to comment.