Skip to content

Commit 761ec49

Browse files
authored
Add files via upload
1 parent 55920f8 commit 761ec49

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

source/ko-engine.min.js

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
/*
2+
* @Name: ko-engine
3+
* @Author: Max Base
4+
* @Repository: https://github.com/basemax/ko-engine
5+
* @Date: 2020-07-16
6+
*/
7+
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 commit comments

Comments
 (0)