Guest User

LoDash Template

a guest
Aug 14th, 2012
93
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. /*!
  2.  Lo-Dash 0.5.0-rc.1 lodash.com/license
  3.  Underscore.js 1.3.3 github.com/documentcloud/underscore/blob/master/LICENSE
  4. */
  5. ;(function(e){"use strict";function t(){}function n(e,t){return S[t]}function r(e){return"\\"+T[e]}function i(e){return x[e]}function s(e,t){if(p.test(t))return"<e%-"+t+"%>";var n=S.length;return S[n]="'+__e("+t+")+'",E+n}function o(e,t,n,r){return e=S.length,t?S[e]="'+__e("+t+")+'":r?S[e]="';"+r+";__p+='":n&&(S[e]="'+((__t=("+n+"))==null?'':__t)+'"),E+e}function u(e,t){if(p.test(t))return"<e%="+t+"%>";var n=S.length;return S[n]="'+((__t=("+t+"))==null?'':__t)+'",E+n}var a,f,l,c,h="object"==typeof
  6. exports&&exports&&("object"==typeof global&&global&&global==global.global&&(e=global),exports),p=/[-+=!~*%&^<>|{(\/]|\[\D|\b(?:delete|in|instanceof|new|typeof|void)\b/,d=/\b__p\+='';/g,v=/\b(__p\+=)''\+/g,m=/(__e\(.*?\)|\b__t\))\+'';/g,g=/(?:__e|__t=)\(\s*(?![\d\s"']|this\.)/g,y=/__token__(\d+)/g,b=/[&<"']/g,w=/['\n\r\t\u2028\u2029\\]/g,E="__token__",S=[],x={"&":"&amp;","<":"&lt;",'"':"&quot;","'":"&#x27;"},T={"\\":"\\","'":"'","\n":"n","\r":"r"," ":"t","\u2028":"u2028","\u2029":"u2029"};t.templateSettings=
  7. {escape:/<%-([\s\S]+?)%>/g,evaluate:/<%([\s\S]+?)%>/g,interpolate:/<%=([\s\S]+?)%>/g,variable:"obj"},t.VERSION="0.5.0-rc.1",t.escape=function(e){return null==e?"":(e+"").replace(b,i)},t.template=function(e,i,h){h||(h={});var p,b;p=h.escape;var E=h.evaluate,x=h.interpolate,T=t.templateSettings,h=h.variable;null==p&&(p=T.escape),null==E&&(E=T.evaluate||!1),null==x&&(x=T.interpolate),p&&(e=e.replace(p,s)),x&&(e=e.replace(x,u)),E!=a&&(a=E,c=RegExp("<e%-([\\s\\S]+?)%>|<e%=([\\s\\S]+?)%>"+(E?"|"+E.source
  8. :""),"g")),p=S.length,e=e.replace(c,o),p=p!=S.length,e="__p += '"+e.replace(w,r).replace(y,n)+"';",S.length=0,h||(h=T.variable||f||"obj",p?e="with("+h+"){"+e+"}":(h!=f&&(f=h,l=RegExp("(\\(\\s*)"+h+"\\."+h+"\\b","g")),e=e.replace(g,"$&"+h+".").replace(l,"$1__d"))),e=(p?e.replace(d,""):e).replace(v,"$1").replace(m,"$1;"),e="function("+h+"){"+h+"||("+h+"={});var __t,__p='',__e=_.escape"+(p?",__j=Array.prototype.join;function print(){__p+=__j.call(arguments,'')}":",__d="+h+"."+h+"||"+h+";")+e+"return __p}"
  9. ;try{b=Function("_","return "+e)(t)}catch(N){b=function(){throw N}}return i?b(i):(b.source=e,b)},typeof define=="function"&&typeof define.amd=="object"&&define.amd?(e._=t,define(function(){return t})):h?"object"==typeof module&&module&&module.a==h?(module.a=t)._=t:h._=t:e._=t})(this);
Advertisement
Add Comment
Please, Sign In to add comment