diff --git a/dist/lodash.compat.js b/dist/lodash.compat.js index 9805c96d8..643a4bdc2 100644 --- a/dist/lodash.compat.js +++ b/dist/lodash.compat.js @@ -65,6 +65,10 @@ reEvaluate = /<%([\s\S]+?)%>/g, reInterpolate = /<%=([\s\S]+?)%>/g; + /** Used to match HTML entities and HTML characters */ + var reEscapedHtml = /&(?:amp|lt|gt|quot|#39);/g, + reUnescapedHtml = /[&<>"']/g; + /** Used to match leading whitespace and zeros to be removed */ var reLeadingSpacesAndZeros = RegExp('^[' + whitespace + ']*0+(?=.$)'); @@ -128,6 +132,31 @@ 'writable': false }; + /** + * Used to convert characters to HTML entities: + * + * Though the `>` character is escaped for symmetry, characters like `>` and `/` + * don't require escaping in HTML and have no special meaning unless they're part + * of a tag or an unquoted attribute value. + * http://mathiasbynens.be/notes/ambiguous-ampersands (under "semi-related fun fact") + */ + var htmlEscapes = { + '&': '&', + '<': '<', + '>': '>', + '"': '"', + "'": ''' + }; + + /** Used to convert HTML entities to characters */ + var htmlUnescapes = { + '&': '&', + '<': '<', + '>': '>', + '"': '"', + ''': "'" + }; + /** Used to determine if values are of the language type Object */ var objectTypes = { 'boolean': false, @@ -1948,29 +1977,6 @@ return nativeKeys(object); }; - /** - * Used to convert characters to HTML entities: - * - * Though the `>` character is escaped for symmetry, characters like `>` and `/` - * don't require escaping in HTML and have no special meaning unless they're part - * of a tag or an unquoted attribute value. - * http://mathiasbynens.be/notes/ambiguous-ampersands (under "semi-related fun fact") - */ - var htmlEscapes = { - '&': '&', - '<': '<', - '>': '>', - '"': '"', - "'": ''' - }; - - /** Used to convert HTML entities to characters */ - var htmlUnescapes = invert(htmlEscapes); - - /** Used to match HTML entities and HTML characters */ - var reEscapedHtml = RegExp('(' + keys(htmlUnescapes).join('|') + ')', 'g'), - reUnescapedHtml = RegExp('[' + keys(htmlEscapes).join('') + ']', 'g'); - /*--------------------------------------------------------------------------*/ /** diff --git a/dist/lodash.compat.min.js b/dist/lodash.compat.min.js index dc7f47890..f362db195 100644 --- a/dist/lodash.compat.min.js +++ b/dist/lodash.compat.min.js @@ -4,58 +4,59 @@ * Build: `lodash -o ./dist/lodash.compat.js` */ ;(function(){function n(n,t,r){r=(r||0)-1;for(var e=n?n.length:0;++ri||typeof a=="undefined")return 1;if(ai||typeof a=="undefined")return 1;if(ar?0:r);++e=b&&a===n,l=[];if(f){var c=o(e);c?(a=t,e=c):f=false}for(;++ua(e,c)&&l.push(c);return f&&p(e),l}function ut(n,t,r){var e=-1,u=n,o=n?n.length:0; -if(t=t&&typeof r=="undefined"?t:nt(t,r,3),typeof o=="number")for(Vr.unindexedChars&&It(u)&&(u=u.split(""));++e=b&&f===n,h=u||g?i():s;for(g&&(h=o(h),f=t);++af(h,y))&&((u||g)&&h.push(y),s.push(v)) -}return g?(c(h.g),p(h)):u&&c(h),s}function ct(n){return function(t,r,e){var u={};if(r=v.createCallback(r,e,3),Gr(t)){e=-1;for(var o=t.length;++eu;u++)e+="l='"+n.d[u]+"';if((!(k&&n[l])&&h.call(p,l))",n.f||(e+="||(!n[l]&&p[l]!==q[l])"),e+="){"+n.c+"}"; -e+="}"}return t("a,f,g,h,j,q,r,o,v,w,y",r+(e+"return s;")+"}")(nt,W,hr,Or,dt,vr,Q,Mr,U,yr,br)}function gt(n){return Qr[n]}function ht(){var t=(t=v.indexOf)===Mt?n:t;return t}function vt(n){return typeof n=="function"&&_r.test(Cr.call(n))}function yt(n){var t,r;return!n||br.call(n)!=M||(t=n.constructor,Ot(t)&&!(t instanceof t))||!Vr.argsClass&&dt(n)||!Vr.nodeClass&&l(n)?false:Vr.ownLast?(ne(n,function(n,t,e){return r=Or.call(e,t),false}),false!==r):(ne(n,function(n,t){r=t}),typeof r=="undefined"||Or.call(n,r)) -}function mt(n){return Xr[n]}function dt(n){return n&&typeof n=="object"&&typeof n.length=="number"&&br.call(n)==F||false}function bt(n,t,r){var e=arguments,u=0,o=typeof r=="number"?2:e.length;if(3=e)return false; -if(typeof n=="string"||!Gr(n)&&It(n))return Tr?Tr.call(n,t,r):-1r?Br(0,e+r):r)||0,-1o&&(o=i)}}else t=null==t&&It(n)?e:v.createCallback(t,r,3),ut(n,function(n,r,e){r=t(n,r,e),r>u&&(u=r,o=n) -});return o}function Bt(n,t,r,e){var u=3>arguments.length;if(t=v.createCallback(t,e,4),Gr(n)){var o=-1,a=n.length;for(u&&(r=n[++o]);++oarguments.length;return t=v.createCallback(t,e,4),$t(n,function(n,e,o){r=u?(u=false,n):t(r,n,e,o)}),r}function Wt(n){var t=-1,r=n?n.length:0,e=er(typeof r=="number"?r:0);return Dt(n,function(n){var r=ft(0,++t);e[t]=e[r],e[r]=n}),e}function zt(n,t,r){var e;if(t=v.createCallback(t,r,3),Gr(n)){r=-1; -for(var u=n.length;++re?Br(0,u+e):e||0}else if(e)return e=Ut(t,r),t[e]===r?e:-1;return n(t,r,e)}function Vt(n,t,r){if(typeof t!="number"&&null!=t){var e=0,u=-1,o=n?n.length:0; -for(t=v.createCallback(t,r,3);++u>>1,r(n[e])r?0:r);++t=h;m?(u&&(u=jr(u)),c=a,o=n.apply(i,e)):u||(u=Ir(y,h))}return m&&f?f=jr(f):f||t===p||(f=Ir(v,t)),r&&(m=true,o=n.apply(i,e)),!m||f||u||(e=i=null),o}}function Yt(n){return n}function Zt(n,t,r){var e=true,u=t&&xt(t);t&&(r||u.length)||(null==r&&(r=t),o=y,t=n,n=v,u=xt(t)),false===r?e=false:Et(r)&&"chain"in r&&(e=r.chain); -var o=n,a=Ot(o);Dt(u,function(r){var u=n[r]=t[r];a&&(o.prototype[r]=function(){var t=this.__chain__,r=this.__wrapped__,a=[r];if(Er.apply(a,arguments),a=u.apply(n,a),e||t){if(r===a&&Et(a))return this;a=new o(a),a.__chain__=t}return a})})}function nr(){}function tr(n){return function(t){return t[n]}}function rr(){return this.__wrapped__}r=r?rt.defaults(Y.Object(),r,rt.pick(Y,D)):Y;var er=r.Array,ur=r.Boolean,or=r.Date,ar=r.Function,ir=r.Math,fr=r.Number,lr=r.Object,cr=r.RegExp,pr=r.String,sr=r.TypeError,gr=[],hr=r.Error.prototype,vr=lr.prototype,yr=pr.prototype,mr=(mr=r.window)&&mr.document,dr=r._,br=vr.toString,_r=cr("^"+pr(br).replace(/[.*+?^${}()|[\]\\]/g,"\\$&").replace(/toString|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),wr=ir.ceil,jr=r.clearTimeout,xr=ir.floor,Cr=ar.prototype.toString,kr=vt(kr=lr.getPrototypeOf)&&kr,Or=vr.hasOwnProperty,Er=gr.push,Sr=vr.propertyIsEnumerable,Ir=r.setTimeout,Ar=gr.splice,Nr=gr.unshift,Rr=function(){try{var n={},t=vt(t=lr.defineProperty)&&t,r=t(n,n,n)&&t -}catch(e){}return r}(),Tr=vt(Tr=yr.contains)&&Tr,Pr=vt(Pr=lr.create)&&Pr,Dr=vt(Dr=er.isArray)&&Dr,$r=r.isFinite,Fr=r.isNaN,qr=vt(qr=lr.keys)&&qr,Br=ir.max,Lr=ir.min,Wr=r.parseInt,zr=ir.random,Kr={};Kr[q]=er,Kr[B]=ur,Kr[L]=or,Kr[z]=ar,Kr[M]=lr,Kr[K]=fr,Kr[V]=cr,Kr[U]=pr;var Mr={};Mr[q]=Mr[L]=Mr[K]={constructor:true,toLocaleString:true,toString:true,valueOf:true},Mr[B]=Mr[U]={constructor:true,toString:true,valueOf:true},Mr[W]=Mr[z]=Mr[V]={constructor:true,toString:true},Mr[M]={constructor:true},function(){for(var n=$.length;n--;){var t,r=$[n]; -for(t in Mr)Or.call(Mr,t)&&!Or.call(Mr[t],r)&&(Mr[t][r]=false)}}(),y.prototype=v.prototype;var Vr=v.support={};!function(){var n=function(){this.x=1},t={0:1,length:1},e=[];n.prototype={valueOf:1,y:1};for(var u in new n)e.push(u);for(u in arguments);Vr.argsClass=br.call(arguments)==F,Vr.argsObject=arguments.constructor==lr&&!(arguments instanceof er),Vr.enumErrorProps=Sr.call(hr,"message")||Sr.call(hr,"name"),Vr.enumPrototypes=Sr.call(n,"prototype"),Vr.funcDecomp=!vt(r.WinRTError)&&T.test(g),Vr.funcNames=typeof ar.name=="string",Vr.nonEnumArgs=0!=u,Vr.nonEnumShadows=!/valueOf/.test(e),Vr.ownLast="x"!=e[0],Vr.spliceObjects=(gr.splice.call(t,0,1),!t[0]),Vr.unindexedChars="xx"!="x"[0]+lr("x")[0]; -try{Vr.dom=11===mr.createDocumentFragment().nodeType}catch(o){Vr.dom=false}try{Vr.nodeClass=!(br.call(undefined)==M&&!({toString:0}+""))}catch(a){Vr.nodeClass=true}}(1),v.templateSettings={escape:S,evaluate:I,interpolate:A,variable:"",imports:{_:v}},Pr||(Z=function(){function n(){}return function(t){if(Et(t)){n.prototype=t;var e=new n;n.prototype=null}return e||r.Object()}}());var Ur=Rr?function(n,t){J.value=t,Rr(n,"__bindData__",J)}:nr;Vr.argsClass||(dt=function(n){return n&&typeof n=="object"&&typeof n.length=="number"&&Or.call(n,"callee")&&!Sr.call(n,"callee")||false -});var Gr=Dr||function(n){return n&&typeof n=="object"&&typeof n.length=="number"&&br.call(n)==q||false},Hr=st({a:"p",b:"[]",e:"",c:"s.push(l)",f:true}),Jr=qr?function(n){return Et(n)?Vr.enumPrototypes&&typeof n=="function"||Vr.nonEnumArgs&&n.length&&dt(n)?Hr(n):qr(n):[]}:Hr,Qr={"&":"&","<":"<",">":">",'"':""","'":"'"},Xr=Ct(Qr),Yr=cr("("+Jr(Xr).join("|")+")","g"),Zr=cr("["+Jr(Qr).join("")+"]","g"),ne=st({a:"p,b,x",b:"p",e:"b=b&&typeof x=='undefined'?b:a(b,x,3)",c:"if(b(p[l],l,p)===false){return s}",f:false}); -Vr.dom||(kt=function(n){return n&&typeof n=="object"&&1===n.nodeType&&!te(n)||false}),Ot(/x/)&&(Ot=function(n){return typeof n=="function"&&br.call(n)==z});var te=kr?function(n){if(!n||br.call(n)!=M||!Vr.argsClass&&dt(n))return false;var t=n.valueOf,r=vt(t)&&(r=kr(t))&&kr(r);return r?n==r||kr(n)==r:yt(n)}:yt,re=ct(function(n,t,r){Or.call(n,r)?n[r]++:n[r]=1}),ee=ct(function(n,t,r){(Or.call(n,r)?n[r]:n[r]=[]).push(t)}),ue=ct(function(n,t,r){n[r]=t}),oe=Ft,ae=vt(ae=or.now)&&ae||function(){return(new or).getTime() -},ie=8==Wr(w+"08")?Wr:function(n,t){return Wr(It(n)?n.replace(N,""):n,t||0)};return v.after=function(n,t){if(!Ot(t))throw new sr;return function(){return 1>--n?t.apply(this,arguments):void 0}},v.assign=bt,v.at=function(n){var t=arguments,r=-1,e=ot(t,true,false,1),t=t[2]&&t[2][t[1]]===n?1:e.length,u=er(t);for(Vr.unindexedChars&&It(n)&&(n=n.split(""));++r=b&&o(e?r[e]:s))) -}var l=r[0],h=-1,v=l?l.length:0,y=[];n:for(;++h(m?t(m,g):f(s,g))){for(e=u,(m||s).push(g);--e;)if(m=a[e],0>(m?t(m,g):f(r[e],g)))continue n;y.push(g)}}for(;u--;)(m=a[u])&&p(m);return c(a),c(s),y},v.invert=Ct,v.invoke=function(n,t){var r=s(arguments,2),e=-1,u=typeof t=="function",o=n?n.length:0,a=er(typeof o=="number"?o:0);return Dt(n,function(n){a[++e]=(u?t:n[t]).apply(n,r)}),a},v.keys=Jr,v.map=Ft,v.mapValues=function(n,t,r){var e={};return t=v.createCallback(t,r,3),wt(n,function(n,r,u){e[r]=t(n,r,u) -}),e},v.max=qt,v.memoize=function(n,t){if(!Ot(n))throw new sr;var r=function(){var e=r.cache,u=t?t.apply(this,arguments):d+arguments[0];return Or.call(e,u)?e[u]:e[u]=n.apply(this,arguments)};return r.cache={},r},v.merge=function(n){var t=arguments,r=2;if(!Et(n))return n;if("number"!=typeof t[2]&&(r=t.length),3r?Br(0,e+r):Lr(r,e-1))+1);e--;)if(n[e]===t)return e;return-1},v.mixin=Zt,v.noConflict=function(){return r._=dr,this},v.noop=nr,v.now=ae,v.parseInt=ie,v.random=function(n,t,r){var e=null==n,u=null==t;return null==r&&(typeof n=="boolean"&&u?(r=n,n=1):u||typeof t!="boolean"||(r=t,u=true)),e&&u&&(t=1),n=+n||0,u?(t=n,n=0):t=+t||0,r||n%1||t%1?(r=zr(),Lr(n+r*(t-n+parseFloat("1e-"+((r+"").length-1))),t)):ft(n,t) -},v.reduce=Bt,v.reduceRight=Lt,v.result=function(n,t){if(n){var r=n[t];return Ot(r)?n[t]():r}},v.runInContext=g,v.size=function(n){var t=n?n.length:0;return typeof t=="number"?t:Jr(n).length},v.some=zt,v.sortedIndex=Ut,v.template=function(n,t,r){var e=v.templateSettings;n=pr(n||""),r=_t({},r,e);var u,o=_t({},r.imports,e.imports),e=Jr(o),o=At(o),i=0,f=r.interpolate||R,l="__p+='",f=cr((r.escape||R).source+"|"+f.source+"|"+(f===A?k:R).source+"|"+(r.evaluate||R).source+"|$","g");n.replace(f,function(t,r,e,o,f,c){return e||(e=o),l+=n.slice(i,c).replace(P,a),r&&(l+="'+__e("+r+")+'"),f&&(u=true,l+="';"+f+";\n__p+='"),e&&(l+="'+((__t=("+e+"))==null?'':__t)+'"),i=c+t.length,t -}),l+="';",f=r=r.variable,f||(r="obj",l="with("+r+"){"+l+"}"),l=(u?l.replace(j,""):l).replace(x,"$1").replace(C,"$1;"),l="function("+r+"){"+(f?"":r+"||("+r+"={});")+"var __t,__p='',__e=_.escape"+(u?",__j=Array.prototype.join;function print(){__p+=__j.call(arguments,'')}":";")+l+"return __p}";try{var c=ar(e,"return "+l).apply(h,o)}catch(p){throw p.source=l,p}return t?c(t):(c.source=l,c)},v.unescape=function(n){return null==n?"":(n=pr(n),0>n.indexOf(";")?n:n.replace(Yr,mt))},v.uniqueId=function(n){var t=++m; -return pr(null==n?"":n)+t},v.all=Rt,v.any=zt,v.detect=Pt,v.findWhere=Pt,v.foldl=Bt,v.foldr=Lt,v.include=Nt,v.inject=Bt,Zt(function(){var n={};return wt(v,function(t,r){v.prototype[r]||(n[r]=t)}),n}(),false),v.first=Kt,v.last=function(n,t,r){var e=0,u=n?n.length:0;if(typeof t!="number"&&null!=t){var o=u;for(t=v.createCallback(t,r,3);o--&&t(n[o],o,n);)e++}else if(e=t,null==e||r)return n?n[u-1]:h;return s(n,Br(0,u-e))},v.sample=function(n,t,r){return n&&typeof n.length!="number"?n=At(n):Vr.unindexedChars&&It(n)&&(n=n.split("")),null==t||r?n?n[ft(0,n.length-1)]:h:(n=Wt(n),n.length=Lr(Br(0,t),n.length),n) -},v.take=Kt,v.head=Kt,wt(v,function(n,t){var r="sample"!==t;v.prototype[t]||(v.prototype[t]=function(t,e){var u=this.__chain__,o=n(this.__wrapped__,t,e);return u||null!=t&&(!e||r&&typeof t=="function")?new y(o,u):o})}),v.VERSION="2.4.1",v.prototype.chain=function(){return this.__chain__=true,this},v.prototype.toString=function(){return pr(this.__wrapped__)},v.prototype.value=rr,v.prototype.valueOf=rr,ut(["join","pop","shift"],function(n){var t=gr[n];v.prototype[n]=function(){var n=this.__chain__,r=t.apply(this.__wrapped__,arguments); -return n?new y(r,n):r}}),ut(["push","reverse","sort","unshift"],function(n){var t=gr[n];v.prototype[n]=function(){return t.apply(this.__wrapped__,arguments),this}}),ut(["concat","slice","splice"],function(n){var t=gr[n];v.prototype[n]=function(){return new y(t.apply(this.__wrapped__,arguments),this.__chain__)}}),Vr.spliceObjects||ut(["pop","shift","splice"],function(n){var t=gr[n],r="splice"==n;v.prototype[n]=function(){var n=this.__chain__,e=this.__wrapped__,u=t.apply(e,arguments);return 0===e.length&&delete e[0],n||r?new y(u,n):u -}}),v}var h,v=[],y=[],m=0,d=+new Date+"",b=75,_=40,w=" \t\x0B\f\xa0\ufeff\n\r\u2028\u2029\u1680\u180e\u2000\u2001\u2002\u2003\u2004\u2005\u2006\u2007\u2008\u2009\u200a\u202f\u205f\u3000",j=/\b__p\+='';/g,x=/\b(__p\+=)''\+/g,C=/(__e\(.*?\)|\b__t\))\+'';/g,k=/\$\{([^\\}]*(?:\\.[^\\}]*)*)\}/g,O=/\w*$/,E=/^\s*function[ \n\r\t]+\w/,S=/<%-([\s\S]+?)%>/g,I=/<%([\s\S]+?)%>/g,A=/<%=([\s\S]+?)%>/g,N=RegExp("^["+w+"]*0+(?=.$)"),R=/($^)/,T=/\bthis\b/,P=/['\n\r\t\u2028\u2029\\]/g,D="Array Boolean Date Error Function Math Number Object RegExp String _ clearTimeout document isFinite isNaN parseInt setTimeout TypeError window WinRTError".split(" "),$="constructor hasOwnProperty isPrototypeOf propertyIsEnumerable toLocaleString toString valueOf".split(" "),F="[object Arguments]",q="[object Array]",B="[object Boolean]",L="[object Date]",W="[object Error]",z="[object Function]",K="[object Number]",M="[object Object]",V="[object RegExp]",U="[object String]",G={}; -G[z]=false,G[F]=G[q]=G[B]=G[L]=G[K]=G[M]=G[V]=G[U]=true;var H={leading:false,maxWait:0,trailing:false},J={configurable:false,enumerable:false,value:null,writable:false},Q={"boolean":false,"function":true,object:true,number:false,string:false,undefined:false},X={"\\":"\\","'":"'","\n":"n","\r":"r","\t":"t","\u2028":"u2028","\u2029":"u2029"},Y=Q[typeof window]&&window||this,Z=Q[typeof exports]&&exports&&!exports.nodeType&&exports,nt=Q[typeof global]&&global;!nt||nt.global!==nt&&nt.window!==nt||(Y=nt);var tt=(nt=Q[typeof module]&&module&&!module.nodeType&&module)&&nt.exports===Z&&Z,rt=g(); -typeof define=="function"&&typeof define.amd=="object"&&define.amd?(Y._=rt, define(function(){return rt})):Z&&nt?tt?(nt.exports=rt)._=rt:Z._=rt:Y._=rt}).call(this); \ No newline at end of file +return u}function g(r){function v(n){return n&&typeof n=="object"&&!Qr(n)&&Ir.call(n,"__wrapped__")?n:new y(n)}function y(n,t){this.__chain__=!!t,this.__wrapped__=n}function _(n){function t(){if(e){var n=s(e);Ar.apply(n,arguments)}if(this instanceof t){var o=et(r.prototype),n=r.apply(o,n||arguments);return At(n)?n:o}return r.apply(u,n||arguments)}var r=n[0],e=n[2],u=n[4];return Jr(t,n),t}function tt(n,t,r,e,u){if(r){var o=r(n);if(typeof o!="undefined")return o}if(!At(n))return n;var a=jr.call(n); +if(!J[a]||!Hr.nodeClass&&l(n))return n;var f=Ur[a];switch(a){case W:case z:return new f(+n);case V:case H:return new f(n);case G:return o=f(n.source,O.exec(n)),o.lastIndex=n.lastIndex,o}if(a=Qr(n),t){var p=!e;e||(e=i()),u||(u=i());for(var g=e.length;g--;)if(e[g]==n)return u[g];o=a?f(n.length):{}}else o=a?s(n):xt({},n);return a&&(Ir.call(n,"index")&&(o.index=n.index),Ir.call(n,"input")&&(o.input=n.input)),t?(e.push(n),u.push(o),(a?ft:kt)(n,function(n,a){o[a]=tt(n,t,r,e,u)}),p&&(c(e),c(u)),o):o}function et(n){return At(n)?qr(n):{} +}function ut(n,t,r){if(typeof n!="function")return tr;if(typeof t=="undefined"||!("prototype"in n))return n;var e=n.__bindData__;if(typeof e=="undefined"&&(Hr.funcNames&&(e=!n.name),e=e||!Hr.funcDecomp,!e)){var u=Er.call(n);Hr.funcNames||(e=!E.test(u)),e||(e=D.test(u),Jr(n,e))}if(false===e||true!==e&&1&e[1])return n;switch(r){case 1:return function(r){return n.call(t,r)};case 2:return function(r,e){return n.call(t,r,e)};case 3:return function(r,e,u){return n.call(t,r,e,u)};case 4:return function(r,e,u,o){return n.call(t,r,e,u,o) +}}return Zt(n,t)}function ot(n){function t(){var n=f?a:this;if(u){var h=s(u);Ar.apply(h,arguments)}return(o||c)&&(h||(h=s(arguments)),o&&Ar.apply(h,o),c&&h.length=b&&a===n,l=[];if(f){var c=o(e);c?(a=t,e=c):f=false}for(;++ua(e,c)&&l.push(c); +return f&&p(e),l}function ft(n,t,r){var e=-1,u=n,o=n?n.length:0;if(t=t&&typeof r=="undefined"?t:ut(t,r,3),typeof o=="number")for(Hr.unindexedChars&&Rt(u)&&(u=u.split(""));++e=b&&f===n,h=u||g?i():s;for(g&&(h=o(h),f=t);++af(h,y))&&((u||g)&&h.push(y),s.push(v))}return g?(c(h.g),p(h)):u&&c(h),s}function ht(n){return function(t,r,e){var u={};if(r=v.createCallback(r,e,3),Qr(t)){e=-1;for(var o=t.length;++eu;u++)e+="l='"+n.d[u]+"';if((!(k&&n[l])&&h.call(p,l))",n.f||(e+="||(!n[l]&&p[l]!==q[l])"),e+="){"+n.c+"}";e+="}"}return t("a,f,g,h,j,q,r,o,v,w,y",r+(e+"return s;")+"}")(ut,K,mr,Ir,jt,dr,nt,Gr,H,br,jr) +}function mt(n){return Y[n]}function dt(){var t=(t=v.indexOf)===Gt?n:t;return t}function bt(n){return typeof n=="function"&&xr.test(Er.call(n))}function _t(n){var t,r;return!n||jr.call(n)!=U||(t=n.constructor,It(t)&&!(t instanceof t))||!Hr.argsClass&&jt(n)||!Hr.nodeClass&&l(n)?false:Hr.ownLast?(Zr(n,function(n,t,e){return r=Ir.call(e,t),false}),false!==r):(Zr(n,function(n,t){r=t}),typeof r=="undefined"||Ir.call(n,r))}function wt(n){return Z[n]}function jt(n){return n&&typeof n=="object"&&typeof n.length=="number"&&jr.call(n)==B||false +}function xt(n,t,r){var e=arguments,u=0,o=typeof r=="number"?2:e.length;if(3=e)return false;if(typeof n=="string"||!Qr(n)&&Rt(n))return $r?$r.call(n,t,r):-1r?zr(0,e+r):r)||0,-1o&&(o=i)}}else t=null==t&&Rt(n)?e:v.createCallback(t,r,3),ft(n,function(n,r,e){r=t(n,r,e),r>u&&(u=r,o=n)});return o}function zt(n,t,r,e){var u=3>arguments.length;if(t=v.createCallback(t,e,4),Qr(n)){var o=-1,a=n.length;for(u&&(r=n[++o]);++oarguments.length;return t=v.createCallback(t,e,4),Bt(n,function(n,e,o){r=u?(u=false,n):t(r,n,e,o)}),r}function Mt(n){var t=-1,r=n?n.length:0,e=ar(typeof r=="number"?r:0);return Ft(n,function(n){var r=st(0,++t);e[t]=e[r],e[r]=n}),e}function Vt(n,t,r){var e;if(t=v.createCallback(t,r,3),Qr(n)){r=-1;for(var u=n.length;++re?zr(0,u+e):e||0}else if(e)return e=Jt(t,r),t[e]===r?e:-1;return n(t,r,e)}function Ht(n,t,r){if(typeof t!="number"&&null!=t){var e=0,u=-1,o=n?n.length:0;for(t=v.createCallback(t,r,3);++u>>1,r(n[e])r?0:r);++t=h;m?(u&&(u=kr(u)),c=a,o=n.apply(i,e)):u||(u=Rr(y,h))}return m&&f?f=kr(f):f||t===p||(f=Rr(v,t)),r&&(m=true,o=n.apply(i,e)),!m||f||u||(e=i=null),o}}function tr(n){return n}function rr(n,t,r){var e=true,u=t&&Et(t);t&&(r||u.length)||(null==r&&(r=t),o=y,t=n,n=v,u=Et(t)),false===r?e=false:At(r)&&"chain"in r&&(e=r.chain);var o=n,a=It(o);Ft(u,function(r){var u=n[r]=t[r];a&&(o.prototype[r]=function(){var t=this.__chain__,r=this.__wrapped__,a=[r];if(Ar.apply(a,arguments),a=u.apply(n,a),e||t){if(r===a&&At(a))return this; +a=new o(a),a.__chain__=t}return a})})}function er(){}function ur(n){return function(t){return t[n]}}function or(){return this.__wrapped__}r=r?at.defaults(rt.Object(),r,at.pick(rt,q)):rt;var ar=r.Array,ir=r.Boolean,fr=r.Date,lr=r.Function,cr=r.Math,pr=r.Number,sr=r.Object,gr=r.RegExp,hr=r.String,vr=r.TypeError,yr=[],mr=r.Error.prototype,dr=sr.prototype,br=hr.prototype,_r=(_r=r.window)&&_r.document,wr=r._,jr=dr.toString,xr=gr("^"+hr(jr).replace(/[.*+?^${}()|[\]\\]/g,"\\$&").replace(/toString|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),Cr=cr.ceil,kr=r.clearTimeout,Or=cr.floor,Er=lr.prototype.toString,Sr=bt(Sr=sr.getPrototypeOf)&&Sr,Ir=dr.hasOwnProperty,Ar=yr.push,Nr=dr.propertyIsEnumerable,Rr=r.setTimeout,Tr=yr.splice,Pr=yr.unshift,Dr=function(){try{var n={},t=bt(t=sr.defineProperty)&&t,r=t(n,n,n)&&t +}catch(e){}return r}(),$r=bt($r=br.contains)&&$r,qr=bt(qr=sr.create)&&qr,Fr=bt(Fr=ar.isArray)&&Fr,Br=r.isFinite,Lr=r.isNaN,Wr=bt(Wr=sr.keys)&&Wr,zr=cr.max,Kr=cr.min,Mr=r.parseInt,Vr=cr.random,Ur={};Ur[L]=ar,Ur[W]=ir,Ur[z]=fr,Ur[M]=lr,Ur[U]=sr,Ur[V]=pr,Ur[G]=gr,Ur[H]=hr;var Gr={};Gr[L]=Gr[z]=Gr[V]={constructor:true,toLocaleString:true,toString:true,valueOf:true},Gr[W]=Gr[H]={constructor:true,toString:true,valueOf:true},Gr[K]=Gr[M]=Gr[G]={constructor:true,toString:true},Gr[U]={constructor:true},function(){for(var n=F.length;n--;){var t,r=F[n]; +for(t in Gr)Ir.call(Gr,t)&&!Ir.call(Gr[t],r)&&(Gr[t][r]=false)}}(),y.prototype=v.prototype;var Hr=v.support={};!function(){var n=function(){this.x=1},t={0:1,length:1},e=[];n.prototype={valueOf:1,y:1};for(var u in new n)e.push(u);for(u in arguments);Hr.argsClass=jr.call(arguments)==B,Hr.argsObject=arguments.constructor==sr&&!(arguments instanceof ar),Hr.enumErrorProps=Nr.call(mr,"message")||Nr.call(mr,"name"),Hr.enumPrototypes=Nr.call(n,"prototype"),Hr.funcDecomp=!bt(r.WinRTError)&&D.test(g),Hr.funcNames=typeof lr.name=="string",Hr.nonEnumArgs=0!=u,Hr.nonEnumShadows=!/valueOf/.test(e),Hr.ownLast="x"!=e[0],Hr.spliceObjects=(yr.splice.call(t,0,1),!t[0]),Hr.unindexedChars="xx"!="x"[0]+sr("x")[0]; +try{Hr.dom=11===_r.createDocumentFragment().nodeType}catch(o){Hr.dom=false}try{Hr.nodeClass=!(jr.call(undefined)==U&&!({toString:0}+""))}catch(a){Hr.nodeClass=true}}(1),v.templateSettings={escape:S,evaluate:I,interpolate:A,variable:"",imports:{_:v}},qr||(et=function(){function n(){}return function(t){if(At(t)){n.prototype=t;var e=new n;n.prototype=null}return e||r.Object()}}());var Jr=Dr?function(n,t){X.value=t,Dr(n,"__bindData__",X)}:er;Hr.argsClass||(jt=function(n){return n&&typeof n=="object"&&typeof n.length=="number"&&Ir.call(n,"callee")&&!Nr.call(n,"callee")||false +});var Qr=Fr||function(n){return n&&typeof n=="object"&&typeof n.length=="number"&&jr.call(n)==L||false},Xr=yt({a:"p",b:"[]",e:"",c:"s.push(l)",f:true}),Yr=Wr?function(n){return At(n)?Hr.enumPrototypes&&typeof n=="function"||Hr.nonEnumArgs&&n.length&&jt(n)?Xr(n):Wr(n):[]}:Xr,Zr=yt({a:"p,b,x",b:"p",e:"b=b&&typeof x=='undefined'?b:a(b,x,3)",c:"if(b(p[l],l,p)===false){return s}",f:false});Hr.dom||(St=function(n){return n&&typeof n=="object"&&1===n.nodeType&&!ne(n)||false}),It(/x/)&&(It=function(n){return typeof n=="function"&&jr.call(n)==M +});var ne=Sr?function(n){if(!n||jr.call(n)!=U||!Hr.argsClass&&jt(n))return false;var t=n.valueOf,r=bt(t)&&(r=Sr(t))&&Sr(r);return r?n==r||Sr(n)==r:_t(n)}:_t,te=ht(function(n,t,r){Ir.call(n,r)?n[r]++:n[r]=1}),re=ht(function(n,t,r){(Ir.call(n,r)?n[r]:n[r]=[]).push(t)}),ee=ht(function(n,t,r){n[r]=t}),ue=Lt,oe=bt(oe=fr.now)&&oe||function(){return(new fr).getTime()},ae=8==Mr(w+"08")?Mr:function(n,t){return Mr(Rt(n)?n.replace(T,""):n,t||0)};return v.after=function(n,t){if(!It(t))throw new vr;return function(){return 1>--n?t.apply(this,arguments):void 0 +}},v.assign=xt,v.at=function(n){var t=arguments,r=-1,e=lt(t,true,false,1),t=t[2]&&t[2][t[1]]===n?1:e.length,u=ar(t);for(Hr.unindexedChars&&Rt(n)&&(n=n.split(""));++r=b&&o(e?r[e]:s)))}var l=r[0],h=-1,v=l?l.length:0,y=[];n:for(;++h(m?t(m,g):f(s,g))){for(e=u,(m||s).push(g);--e;)if(m=a[e],0>(m?t(m,g):f(r[e],g)))continue n;y.push(g) +}}for(;u--;)(m=a[u])&&p(m);return c(a),c(s),y},v.invert=function(n,t){for(var r=-1,e=Yr(n),u=e.length,o={};++rr?zr(0,e+r):Kr(r,e-1))+1);e--;)if(n[e]===t)return e;return-1},v.mixin=rr,v.noConflict=function(){return r._=wr,this},v.noop=er,v.now=oe,v.parseInt=ae,v.random=function(n,t,r){var e=null==n,u=null==t;return null==r&&(typeof n=="boolean"&&u?(r=n,n=1):u||typeof t!="boolean"||(r=t,u=true)),e&&u&&(t=1),n=+n||0,u?(t=n,n=0):t=+t||0,r||n%1||t%1?(r=Vr(),Kr(n+r*(t-n+parseFloat("1e-"+((r+"").length-1))),t)):st(n,t) +},v.reduce=zt,v.reduceRight=Kt,v.result=function(n,t){if(n){var r=n[t];return It(r)?n[t]():r}},v.runInContext=g,v.size=function(n){var t=n?n.length:0;return typeof t=="number"?t:Yr(n).length},v.some=Vt,v.sortedIndex=Jt,v.template=function(n,t,r){var e=v.templateSettings;n=hr(n||""),r=Ct({},r,e);var u,o=Ct({},r.imports,e.imports),e=Yr(o),o=Tt(o),i=0,f=r.interpolate||P,l="__p+='",f=gr((r.escape||P).source+"|"+f.source+"|"+(f===A?k:P).source+"|"+(r.evaluate||P).source+"|$","g");n.replace(f,function(t,r,e,o,f,c){return e||(e=o),l+=n.slice(i,c).replace($,a),r&&(l+="'+__e("+r+")+'"),f&&(u=true,l+="';"+f+";\n__p+='"),e&&(l+="'+((__t=("+e+"))==null?'':__t)+'"),i=c+t.length,t +}),l+="';",f=r=r.variable,f||(r="obj",l="with("+r+"){"+l+"}"),l=(u?l.replace(j,""):l).replace(x,"$1").replace(C,"$1;"),l="function("+r+"){"+(f?"":r+"||("+r+"={});")+"var __t,__p='',__e=_.escape"+(u?",__j=Array.prototype.join;function print(){__p+=__j.call(arguments,'')}":";")+l+"return __p}";try{var c=lr(e,"return "+l).apply(h,o)}catch(p){throw p.source=l,p}return t?c(t):(c.source=l,c)},v.unescape=function(n){return null==n?"":(n=hr(n),0>n.indexOf(";")?n:n.replace(N,wt))},v.uniqueId=function(n){var t=++m; +return hr(null==n?"":n)+t},v.all=Dt,v.any=Vt,v.detect=qt,v.findWhere=qt,v.foldl=zt,v.foldr=Kt,v.include=Pt,v.inject=zt,rr(function(){var n={};return kt(v,function(t,r){v.prototype[r]||(n[r]=t)}),n}(),false),v.first=Ut,v.last=function(n,t,r){var e=0,u=n?n.length:0;if(typeof t!="number"&&null!=t){var o=u;for(t=v.createCallback(t,r,3);o--&&t(n[o],o,n);)e++}else if(e=t,null==e||r)return n?n[u-1]:h;return s(n,zr(0,u-e))},v.sample=function(n,t,r){return n&&typeof n.length!="number"?n=Tt(n):Hr.unindexedChars&&Rt(n)&&(n=n.split("")),null==t||r?n?n[st(0,n.length-1)]:h:(n=Mt(n),n.length=Kr(zr(0,t),n.length),n) +},v.take=Ut,v.head=Ut,kt(v,function(n,t){var r="sample"!==t;v.prototype[t]||(v.prototype[t]=function(t,e){var u=this.__chain__,o=n(this.__wrapped__,t,e);return u||null!=t&&(!e||r&&typeof t=="function")?new y(o,u):o})}),v.VERSION="2.4.1",v.prototype.chain=function(){return this.__chain__=true,this},v.prototype.toString=function(){return hr(this.__wrapped__)},v.prototype.value=or,v.prototype.valueOf=or,ft(["join","pop","shift"],function(n){var t=yr[n];v.prototype[n]=function(){var n=this.__chain__,r=t.apply(this.__wrapped__,arguments); +return n?new y(r,n):r}}),ft(["push","reverse","sort","unshift"],function(n){var t=yr[n];v.prototype[n]=function(){return t.apply(this.__wrapped__,arguments),this}}),ft(["concat","slice","splice"],function(n){var t=yr[n];v.prototype[n]=function(){return new y(t.apply(this.__wrapped__,arguments),this.__chain__)}}),Hr.spliceObjects||ft(["pop","shift","splice"],function(n){var t=yr[n],r="splice"==n;v.prototype[n]=function(){var n=this.__chain__,e=this.__wrapped__,u=t.apply(e,arguments);return 0===e.length&&delete e[0],n||r?new y(u,n):u +}}),v}var h,v=[],y=[],m=0,d=+new Date+"",b=75,_=40,w=" \t\x0B\f\xa0\ufeff\n\r\u2028\u2029\u1680\u180e\u2000\u2001\u2002\u2003\u2004\u2005\u2006\u2007\u2008\u2009\u200a\u202f\u205f\u3000",j=/\b__p\+='';/g,x=/\b(__p\+=)''\+/g,C=/(__e\(.*?\)|\b__t\))\+'';/g,k=/\$\{([^\\}]*(?:\\.[^\\}]*)*)\}/g,O=/\w*$/,E=/^\s*function[ \n\r\t]+\w/,S=/<%-([\s\S]+?)%>/g,I=/<%([\s\S]+?)%>/g,A=/<%=([\s\S]+?)%>/g,N=/&(?:amp|lt|gt|quot|#39);/g,R=/[&<>"']/g,T=RegExp("^["+w+"]*0+(?=.$)"),P=/($^)/,D=/\bthis\b/,$=/['\n\r\t\u2028\u2029\\]/g,q="Array Boolean Date Error Function Math Number Object RegExp String _ clearTimeout document isFinite isNaN parseInt setTimeout TypeError window WinRTError".split(" "),F="constructor hasOwnProperty isPrototypeOf propertyIsEnumerable toLocaleString toString valueOf".split(" "),B="[object Arguments]",L="[object Array]",W="[object Boolean]",z="[object Date]",K="[object Error]",M="[object Function]",V="[object Number]",U="[object Object]",G="[object RegExp]",H="[object String]",J={}; +J[M]=false,J[B]=J[L]=J[W]=J[z]=J[V]=J[U]=J[G]=J[H]=true;var Q={leading:false,maxWait:0,trailing:false},X={configurable:false,enumerable:false,value:null,writable:false},Y={"&":"&","<":"<",">":">",'"':""","'":"'"},Z={"&":"&","<":"<",">":">",""":'"',"'":"'"},nt={"boolean":false,"function":true,object:true,number:false,string:false,undefined:false},tt={"\\":"\\","'":"'","\n":"n","\r":"r","\t":"t","\u2028":"u2028","\u2029":"u2029"},rt=nt[typeof window]&&window||this,et=nt[typeof exports]&&exports&&!exports.nodeType&&exports,ut=nt[typeof global]&&global; +!ut||ut.global!==ut&&ut.window!==ut||(rt=ut);var ot=(ut=nt[typeof module]&&module&&!module.nodeType&&module)&&ut.exports===et&&et,at=g();typeof define=="function"&&typeof define.amd=="object"&&define.amd?(rt._=at, define(function(){return at})):et&&ut?ot?(ut.exports=at)._=at:et._=at:rt._=at}).call(this); \ No newline at end of file diff --git a/dist/lodash.js b/dist/lodash.js index 85b66cd38..2a0895db8 100644 --- a/dist/lodash.js +++ b/dist/lodash.js @@ -62,6 +62,10 @@ reEvaluate = /<%([\s\S]+?)%>/g, reInterpolate = /<%=([\s\S]+?)%>/g; + /** Used to match HTML entities and HTML characters */ + var reEscapedHtml = /&(?:amp|lt|gt|quot|#39);/g, + reUnescapedHtml = /[&<>"']/g; + /** Used to match leading whitespace and zeros to be removed */ var reLeadingSpacesAndZeros = RegExp('^[' + whitespace + ']*0+(?=.$)'); @@ -118,6 +122,31 @@ 'writable': false }; + /** + * Used to convert characters to HTML entities: + * + * Though the `>` character is escaped for symmetry, characters like `>` and `/` + * don't require escaping in HTML and have no special meaning unless they're part + * of a tag or an unquoted attribute value. + * http://mathiasbynens.be/notes/ambiguous-ampersands (under "semi-related fun fact") + */ + var htmlEscapes = { + '&': '&', + '<': '<', + '>': '>', + '"': '"', + "'": ''' + }; + + /** Used to convert HTML entities to characters */ + var htmlUnescapes = { + '&': '&', + '<': '<', + '>': '>', + '"': '"', + ''': "'" + }; + /** Used to determine if values are of the language type Object */ var objectTypes = { 'boolean': false, @@ -1641,29 +1670,6 @@ return nativeKeys(object); }; - /** - * Used to convert characters to HTML entities: - * - * Though the `>` character is escaped for symmetry, characters like `>` and `/` - * don't require escaping in HTML and have no special meaning unless they're part - * of a tag or an unquoted attribute value. - * http://mathiasbynens.be/notes/ambiguous-ampersands (under "semi-related fun fact") - */ - var htmlEscapes = { - '&': '&', - '<': '<', - '>': '>', - '"': '"', - "'": ''' - }; - - /** Used to convert HTML entities to characters */ - var htmlUnescapes = invert(htmlEscapes); - - /** Used to match HTML entities and HTML characters */ - var reEscapedHtml = RegExp('(' + keys(htmlUnescapes).join('|') + ')', 'g'), - reUnescapedHtml = RegExp('[' + keys(htmlEscapes).join('') + ']', 'g'); - /*--------------------------------------------------------------------------*/ /** diff --git a/dist/lodash.min.js b/dist/lodash.min.js index bf8fe9504..2011c2f70 100644 --- a/dist/lodash.min.js +++ b/dist/lodash.min.js @@ -4,53 +4,52 @@ * Build: `lodash modern -o ./dist/lodash.js` */ ;(function(){function n(n,t,e){e=(e||0)-1;for(var r=n?n.length:0;++ea||typeof i=="undefined")return 1;if(ie?0:e);++r=b&&i===n,l=[]; -if(f){var p=o(r);p?(i=t,r=p):f=false}for(;++ui(r,p)&&l.push(p);return f&&c(r),l}function rt(n,t,e,r){r=(r||0)-1;for(var u=n?n.length:0,o=[];++r=b&&f===n,h=u||v?a():s;for(v&&(h=o(h),f=t);++if(h,y))&&((u||v)&&h.push(y),s.push(g)) -}return v?(l(h.g),c(h)):u&&l(h),s}function ft(n){return function(t,e,r){var u={};e=d.createCallback(e,r,3),r=-1;var o=t?t.length:0;if(typeof o=="number")for(;++r=r)return false;if(typeof n=="string"||!Ke(n)&&Ot(n))return Ne?Ne.call(n,t,e):-1e?De(0,r+e):e)||0,-1o&&(o=a)}}else t=null==t&&Ot(n)?r:d.createCallback(t,e,3),Tt(n,function(n,e,r){e=t(n,e,r),e>u&&(u=e,o=n)});return o}function Ft(n,t,e,r){if(!n)return e;var u=3>arguments.length;t=d.createCallback(t,r,4);var o=-1,i=n.length;if(typeof i=="number")for(u&&(e=n[++o]);++oarguments.length;return t=d.createCallback(t,r,4),At(n,function(n,r,o){e=u?(u=false,n):t(e,n,r,o)}),e}function Wt(n){var t=-1,e=n?n.length:0,r=ne(typeof e=="number"?e:0);return Tt(n,function(n){var e=it(0,++t);r[t]=r[e],r[e]=n}),r}function qt(n,t,e){var r;t=d.createCallback(t,e,3),e=-1;var u=n?n.length:0;if(typeof u=="number")for(;++er?De(0,u+r):r||0}else if(r)return r=Lt(t,e),t[r]===e?r:-1;return n(t,e,r)}function Kt(n,t,e){if(typeof t!="number"&&null!=t){var r=0,u=-1,o=n?n.length:0;for(t=d.createCallback(t,e,3);++u>>1,e(n[r])e?0:e);++t=v; -m?(i&&(i=be(i)),s=f,a=n.apply(l,o)):i||(i=xe(r,v))}return m&&c?c=be(c):c||t===h||(c=xe(u,t)),e&&(m=true,a=n.apply(l,o)),!m||c||i||(o=l=null),a}}function Jt(n){return n}function Qt(n,t,e){var r=true,u=t&&_t(t);t&&(e||u.length)||(null==e&&(e=t),o=H,t=n,n=d,u=_t(t)),false===e?r=false:xt(e)&&"chain"in e&&(r=e.chain);var o=n,i=kt(o);Tt(u,function(e){var u=n[e]=t[e];i&&(o.prototype[e]=function(){var t=this.__chain__,e=this.__wrapped__,i=[e];if(ke.apply(i,arguments),i=u.apply(n,i),r||t){if(e===i&&xt(i))return this; -i=new o(i),i.__chain__=t}return i})})}function Xt(){}function Yt(n){return function(t){return t[n]}}function Zt(){return this.__wrapped__}e=e?Z.defaults(J.Object(),e,Z.pick(J,D)):J;var ne=e.Array,te=e.Boolean,ee=e.Date,re=e.Function,ue=e.Math,oe=e.Number,ie=e.Object,ae=e.RegExp,fe=e.String,le=e.TypeError,ce=[],pe=ie.prototype,se=fe.prototype,ve=(ve=e.window)&&ve.document,he=e._,ge=pe.toString,ye=ae("^"+fe(ge).replace(/[.*+?^${}()|[\]\\]/g,"\\$&").replace(/toString|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),me=ue.ceil,be=e.clearTimeout,de=ue.floor,_e=re.prototype.toString,we=st(we=ie.getPrototypeOf)&&we,je=pe.hasOwnProperty,ke=ce.push,xe=e.setTimeout,Ce=ce.splice,Oe=ce.unshift,Ee=function(){try{var n={},t=st(t=ie.defineProperty)&&t,e=t(n,n,n)&&t -}catch(r){}return e}(),Ne=st(Ne=se.contains)&&Ne,Ie=st(Ie=ie.create)&&Ie,Re=st(Re=ne.isArray)&&Re,Se=e.isFinite,Te=e.isNaN,Ae=st(Ae=ie.keys)&&Ae,De=ue.max,$e=ue.min,Fe=e.parseInt,Be=ue.random,We={};We[F]=ne,We[B]=te,We[W]=ee,We[q]=re,We[P]=ie,We[z]=oe,We[K]=ae,We[L]=fe,H.prototype=d.prototype;var qe=d.support={};qe.funcDecomp=!st(e.WinRTError)&&T.test(s),qe.funcNames=typeof re.name=="string";try{qe.dom=11===ve.createDocumentFragment().nodeType}catch(ze){qe.dom=false}d.templateSettings={escape:E,evaluate:N,interpolate:I,variable:"",imports:{_:d}},Ie||(Y=function(){function n(){}return function(t){if(xt(t)){n.prototype=t; -var r=new n;n.prototype=null}return r||e.Object()}}());var Pe=Ee?function(n,t){U.value=t,Ee(n,"__bindData__",U)}:Xt,Ke=Re||function(n){return n&&typeof n=="object"&&typeof n.length=="number"&&ge.call(n)==F||false},Le=Ae?function(n){return xt(n)?Ae(n):[]}:g,Me={"&":"&","<":"<",">":">",'"':""","'":"'"},Ve=wt(Me),Ue=ae("("+Le(Ve).join("|")+")","g"),Ge=ae("["+Le(Me).join("")+"]","g");qe.dom||(jt=function(n){return n&&typeof n=="object"&&1===n.nodeType&&!He(n)||false});var He=we?function(n){if(!n||ge.call(n)!=P)return false; -var t=n.valueOf,e=st(t)&&(e=we(t))&&we(e);return e?n==e||we(n)==e:vt(n)}:vt,Je=ft(function(n,t,e){je.call(n,e)?n[e]++:n[e]=1}),Qe=ft(function(n,t,e){(je.call(n,e)?n[e]:n[e]=[]).push(t)}),Xe=ft(function(n,t,e){n[e]=t}),Ye=Dt,Ze=st(Ze=ee.now)&&Ze||function(){return(new ee).getTime()},nr=8==Fe(_+"08")?Fe:function(n,t){return Fe(Ot(n)?n.replace(R,""):n,t||0)};return d.after=function(n,t){if(!kt(t))throw new le;return function(){return 1>--n?t.apply(this,arguments):void 0}},d.assign=yt,d.at=function(n){for(var t=arguments,e=-1,r=rt(t,true,false,1),t=t[2]&&t[2][t[1]]===n?1:r.length,u=ne(t);++e=b&&o(r?e[r]:s)))}var p=e[0],h=-1,g=p?p.length:0,y=[];n:for(;++h(m?t(m,v):f(s,v))){for(r=u,(m||s).push(v);--r;)if(m=i[r],0>(m?t(m,v):f(e[r],v)))continue n;y.push(v)}}for(;u--;)(m=i[u])&&c(m);return l(i),l(s),y},d.invert=wt,d.invoke=function(n,t){var e=p(arguments,2),r=-1,u=typeof t=="function",o=n?n.length:0,i=ne(typeof o=="number"?o:0);return Tt(n,function(n){i[++r]=(u?t:n[t]).apply(n,e)}),i},d.keys=Le,d.map=Dt,d.mapValues=function(n,t,e){var r={}; -return t=d.createCallback(t,e,3),bt(n,function(n,e,u){r[e]=t(n,e,u)}),r},d.max=$t,d.memoize=function(n,t){function e(){var r=e.cache,u=t?t.apply(this,arguments):m+arguments[0];return je.call(r,u)?r[u]:r[u]=n.apply(this,arguments)}if(!kt(n))throw new le;return e.cache={},e},d.merge=function(n){var t=arguments,e=2;if(!xt(n))return n;if("number"!=typeof t[2]&&(e=t.length),3e?De(0,r+e):$e(e,r-1))+1);r--;)if(n[r]===t)return r;return-1},d.mixin=Qt,d.noConflict=function(){return e._=he,this},d.noop=Xt,d.now=Ze,d.parseInt=nr,d.random=function(n,t,e){var r=null==n,u=null==t;return null==e&&(typeof n=="boolean"&&u?(e=n,n=1):u||typeof t!="boolean"||(e=t,u=true)),r&&u&&(t=1),n=+n||0,u?(t=n,n=0):t=+t||0,e||n%1||t%1?(e=Be(),$e(n+e*(t-n+parseFloat("1e-"+((e+"").length-1))),t)):it(n,t) -},d.reduce=Ft,d.reduceRight=Bt,d.result=function(n,t){if(n){var e=n[t];return kt(e)?n[t]():e}},d.runInContext=s,d.size=function(n){var t=n?n.length:0;return typeof t=="number"?t:Le(n).length},d.some=qt,d.sortedIndex=Lt,d.template=function(n,t,e){var r=d.templateSettings;n=fe(n||""),e=mt({},e,r);var u,o=mt({},e.imports,r.imports),r=Le(o),o=Et(o),a=0,f=e.interpolate||S,l="__p+='",f=ae((e.escape||S).source+"|"+f.source+"|"+(f===I?x:S).source+"|"+(e.evaluate||S).source+"|$","g");n.replace(f,function(t,e,r,o,f,c){return r||(r=o),l+=n.slice(a,c).replace(A,i),e&&(l+="'+__e("+e+")+'"),f&&(u=true,l+="';"+f+";\n__p+='"),r&&(l+="'+((__t=("+r+"))==null?'':__t)+'"),a=c+t.length,t -}),l+="';",f=e=e.variable,f||(e="obj",l="with("+e+"){"+l+"}"),l=(u?l.replace(w,""):l).replace(j,"$1").replace(k,"$1;"),l="function("+e+"){"+(f?"":e+"||("+e+"={});")+"var __t,__p='',__e=_.escape"+(u?",__j=Array.prototype.join;function print(){__p+=__j.call(arguments,'')}":";")+l+"return __p}";try{var c=re(r,"return "+l).apply(v,o)}catch(p){throw p.source=l,p}return t?c(t):(c.source=l,c)},d.unescape=function(n){return null==n?"":(n=fe(n),0>n.indexOf(";")?n:n.replace(Ue,ht))},d.uniqueId=function(n){var t=++y; -return fe(null==n?"":n)+t},d.all=It,d.any=qt,d.detect=St,d.findWhere=St,d.foldl=Ft,d.foldr=Bt,d.include=Nt,d.inject=Ft,Qt(function(){var n={};return bt(d,function(t,e){d.prototype[e]||(n[e]=t)}),n}(),false),d.first=zt,d.last=function(n,t,e){var r=0,u=n?n.length:0;if(typeof t!="number"&&null!=t){var o=u;for(t=d.createCallback(t,e,3);o--&&t(n[o],o,n);)r++}else if(r=t,null==r||e)return n?n[u-1]:v;return p(n,De(0,u-r))},d.sample=function(n,t,e){return n&&typeof n.length!="number"&&(n=Et(n)),null==t||e?n?n[it(0,n.length-1)]:v:(n=Wt(n),n.length=$e(De(0,t),n.length),n) -},d.take=zt,d.head=zt,bt(d,function(n,t){var e="sample"!==t;d.prototype[t]||(d.prototype[t]=function(t,r){var u=this.__chain__,o=n(this.__wrapped__,t,r);return u||null!=t&&(!r||e&&typeof t=="function")?new H(o,u):o})}),d.VERSION="2.4.1",d.prototype.chain=function(){return this.__chain__=true,this},d.prototype.toString=function(){return fe(this.__wrapped__)},d.prototype.value=Zt,d.prototype.valueOf=Zt,Tt(["join","pop","shift"],function(n){var t=ce[n];d.prototype[n]=function(){var n=this.__chain__,e=t.apply(this.__wrapped__,arguments); -return n?new H(e,n):e}}),Tt(["push","reverse","sort","unshift"],function(n){var t=ce[n];d.prototype[n]=function(){return t.apply(this.__wrapped__,arguments),this}}),Tt(["concat","slice","splice"],function(n){var t=ce[n];d.prototype[n]=function(){return new H(t.apply(this.__wrapped__,arguments),this.__chain__)}}),d}var v,h=[],g=[],y=0,m=+new Date+"",b=75,d=40,_=" \t\x0B\f\xa0\ufeff\n\r\u2028\u2029\u1680\u180e\u2000\u2001\u2002\u2003\u2004\u2005\u2006\u2007\u2008\u2009\u200a\u202f\u205f\u3000",w=/\b__p\+='';/g,j=/\b(__p\+=)''\+/g,k=/(__e\(.*?\)|\b__t\))\+'';/g,x=/\$\{([^\\}]*(?:\\.[^\\}]*)*)\}/g,C=/\w*$/,O=/^\s*function[ \n\r\t]+\w/,E=/<%-([\s\S]+?)%>/g,N=/<%([\s\S]+?)%>/g,I=/<%=([\s\S]+?)%>/g,R=RegExp("^["+_+"]*0+(?=.$)"),S=/($^)/,T=/\bthis\b/,A=/['\n\r\t\u2028\u2029\\]/g,D="Array Boolean Date Function Math Number Object RegExp String _ clearTimeout document isFinite isNaN parseInt setTimeout TypeError window WinRTError".split(" "),$="[object Arguments]",F="[object Array]",B="[object Boolean]",W="[object Date]",q="[object Function]",z="[object Number]",P="[object Object]",K="[object RegExp]",L="[object String]",M={}; -M[q]=false,M[$]=M[F]=M[B]=M[W]=M[z]=M[P]=M[K]=M[L]=true;var V={leading:false,maxWait:0,trailing:false},U={configurable:false,enumerable:false,value:null,writable:false},G={"boolean":false,"function":true,object:true,number:false,string:false,undefined:false},H={"\\":"\\","'":"'","\n":"n","\r":"r","\t":"t","\u2028":"u2028","\u2029":"u2029"},J=G[typeof window]&&window||this,Q=G[typeof exports]&&exports&&!exports.nodeType&&exports,X=G[typeof global]&&global;!X||X.global!==X&&X.window!==X||(J=X);var Y=(X=G[typeof module]&&module&&!module.nodeType&&module)&&X.exports===Q&&Q,Z=s(); -typeof define=="function"&&typeof define.amd=="object"&&define.amd?(J._=Z, define(function(){return Z})):Q&&X?Y?(X.exports=Z)._=Z:Q._=Z:J._=Z}).call(this); \ No newline at end of file +}}function r(n){return n.charCodeAt(0)}function u(n,t){for(var e=n.i,r=t.i,u=-1,o=e.length;++ua||typeof i=="undefined")return 1;if(ie?0:e);++r=b&&i===n,l=[]; +if(f){var p=o(r);p?(i=t,r=p):f=false}for(;++ui(r,p)&&l.push(p);return f&&c(r),l}function at(n,t,e,r){r=(r||0)-1;for(var u=n?n.length:0,o=[];++r=b&&f===n,g=u||v?a():s;for(v&&(g=o(g),f=t);++if(g,y))&&((u||v)&&g.push(y),s.push(h)) +}return v?(l(g.g),c(g)):u&&l(g),s}function st(n){return function(t,e,r){var u={};e=d.createCallback(e,r,3),r=-1;var o=t?t.length:0;if(typeof o=="number")for(;++r=r)return false;if(typeof n=="string"||!Ve(n)&&It(n))return Se?Se.call(n,t,e):-1e?Be(0,r+e):e)||0,-1o&&(o=a)}}else t=null==t&&It(n)?r:d.createCallback(t,e,3),$t(n,function(n,e,r){e=t(n,e,r),e>u&&(u=e,o=n)});return o}function Wt(n,t,e,r){if(!n)return e;var u=3>arguments.length;t=d.createCallback(t,r,4);var o=-1,i=n.length;if(typeof i=="number")for(u&&(e=n[++o]);++oarguments.length;return t=d.createCallback(t,r,4),Ft(n,function(n,r,o){e=u?(u=false,n):t(e,n,r,o) +}),e}function Pt(n){var t=-1,e=n?n.length:0,r=re(typeof e=="number"?e:0);return $t(n,function(n){var e=ct(0,++t);r[t]=r[e],r[e]=n}),r}function Kt(n,t,e){var r;t=d.createCallback(t,e,3),e=-1;var u=n?n.length:0;if(typeof u=="number")for(;++er?Be(0,u+r):r||0}else if(r)return r=Ut(t,e),t[r]===e?r:-1;return n(t,e,r)}function Vt(n,t,e){if(typeof t!="number"&&null!=t){var r=0,u=-1,o=n?n.length:0;for(t=d.createCallback(t,e,3);++u>>1,e(n[r])e?0:e);++t=v;m?(i&&(i=we(i)),s=f,a=n.apply(l,o)):i||(i=Ee(r,v))}return m&&c?c=we(c):c||t===g||(c=Ee(u,t)),e&&(m=true,a=n.apply(l,o)),!m||c||i||(o=l=null),a}}function Yt(n){return n}function Zt(n,t,e){var r=true,u=t&&xt(t); +t&&(e||u.length)||(null==e&&(e=t),o=Y,t=n,n=d,u=xt(t)),false===e?r=false:Et(e)&&"chain"in e&&(r=e.chain);var o=n,i=Ot(o);$t(u,function(e){var u=n[e]=t[e];i&&(o.prototype[e]=function(){var t=this.__chain__,e=this.__wrapped__,i=[e];if(Oe.apply(i,arguments),i=u.apply(n,i),r||t){if(e===i&&Et(i))return this;i=new o(i),i.__chain__=t}return i})})}function ne(){}function te(n){return function(t){return t[n]}}function ee(){return this.__wrapped__}e=e?rt.defaults(Z.Object(),e,rt.pick(Z,F)):Z;var re=e.Array,ue=e.Boolean,oe=e.Date,ie=e.Function,ae=e.Math,fe=e.Number,le=e.Object,ce=e.RegExp,pe=e.String,se=e.TypeError,ve=[],ge=le.prototype,he=pe.prototype,ye=(ye=e.window)&&ye.document,me=e._,be=ge.toString,de=ce("^"+pe(be).replace(/[.*+?^${}()|[\]\\]/g,"\\$&").replace(/toString|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),_e=ae.ceil,we=e.clearTimeout,je=ae.floor,ke=ie.prototype.toString,xe=yt(xe=le.getPrototypeOf)&&xe,Ce=ge.hasOwnProperty,Oe=ve.push,Ee=e.setTimeout,Ne=ve.splice,Ie=ve.unshift,Re=function(){try{var n={},t=yt(t=le.defineProperty)&&t,e=t(n,n,n)&&t +}catch(r){}return e}(),Se=yt(Se=he.contains)&&Se,Te=yt(Te=le.create)&&Te,Ae=yt(Ae=re.isArray)&&Ae,De=e.isFinite,$e=e.isNaN,Fe=yt(Fe=le.keys)&&Fe,Be=ae.max,qe=ae.min,We=e.parseInt,ze=ae.random,Pe={};Pe[q]=re,Pe[W]=ue,Pe[z]=oe,Pe[P]=ie,Pe[L]=le,Pe[K]=fe,Pe[M]=ce,Pe[V]=pe,Y.prototype=d.prototype;var Ke=d.support={};Ke.funcDecomp=!yt(e.WinRTError)&&D.test(s),Ke.funcNames=typeof ie.name=="string";try{Ke.dom=11===ye.createDocumentFragment().nodeType}catch(Le){Ke.dom=false}d.templateSettings={escape:E,evaluate:N,interpolate:I,variable:"",imports:{_:d}},Te||(et=function(){function n(){}return function(t){if(Et(t)){n.prototype=t; +var r=new n;n.prototype=null}return r||e.Object()}}());var Me=Re?function(n,t){H.value=t,Re(n,"__bindData__",H)}:ne,Ve=Ae||function(n){return n&&typeof n=="object"&&typeof n.length=="number"&&be.call(n)==q||false},Ue=Fe?function(n){return Et(n)?Fe(n):[]}:h;Ke.dom||(Ct=function(n){return n&&typeof n=="object"&&1===n.nodeType&&!Ge(n)||false});var Ge=xe?function(n){if(!n||be.call(n)!=L)return false;var t=n.valueOf,e=yt(t)&&(e=xe(t))&&xe(e);return e?n==e||xe(n)==e:mt(n)}:mt,He=st(function(n,t,e){Ce.call(n,e)?n[e]++:n[e]=1 +}),Je=st(function(n,t,e){(Ce.call(n,e)?n[e]:n[e]=[]).push(t)}),Qe=st(function(n,t,e){n[e]=t}),Xe=Bt,Ye=yt(Ye=oe.now)&&Ye||function(){return(new oe).getTime()},Ze=8==We(_+"08")?We:function(n,t){return We(It(n)?n.replace(T,""):n,t||0)};return d.after=function(n,t){if(!Ot(t))throw new se;return function(){return 1>--n?t.apply(this,arguments):void 0}},d.assign=_t,d.at=function(n){for(var t=arguments,e=-1,r=at(t,true,false,1),t=t[2]&&t[2][t[1]]===n?1:r.length,u=re(t);++e=b&&o(r?e[r]:s))) +}var p=e[0],g=-1,h=p?p.length:0,y=[];n:for(;++g(m?t(m,v):f(s,v))){for(r=u,(m||s).push(v);--r;)if(m=i[r],0>(m?t(m,v):f(e[r],v)))continue n;y.push(v)}}for(;u--;)(m=i[u])&&c(m);return l(i),l(s),y},d.invert=function(n,t){for(var e=-1,r=Ue(n),u=r.length,o={};++ee?Be(0,r+e):qe(e,r-1))+1);r--;)if(n[r]===t)return r;return-1},d.mixin=Zt,d.noConflict=function(){return e._=me,this},d.noop=ne,d.now=Ye,d.parseInt=Ze,d.random=function(n,t,e){var r=null==n,u=null==t;return null==e&&(typeof n=="boolean"&&u?(e=n,n=1):u||typeof t!="boolean"||(e=t,u=true)),r&&u&&(t=1),n=+n||0,u?(t=n,n=0):t=+t||0,e||n%1||t%1?(e=ze(),qe(n+e*(t-n+parseFloat("1e-"+((e+"").length-1))),t)):ct(n,t) +},d.reduce=Wt,d.reduceRight=zt,d.result=function(n,t){if(n){var e=n[t];return Ot(e)?n[t]():e}},d.runInContext=s,d.size=function(n){var t=n?n.length:0;return typeof t=="number"?t:Ue(n).length},d.some=Kt,d.sortedIndex=Ut,d.template=function(n,t,e){var r=d.templateSettings;n=pe(n||""),e=wt({},e,r);var u,o=wt({},e.imports,r.imports),r=Ue(o),o=Rt(o),a=0,f=e.interpolate||A,l="__p+='",f=ce((e.escape||A).source+"|"+f.source+"|"+(f===I?x:A).source+"|"+(e.evaluate||A).source+"|$","g");n.replace(f,function(t,e,r,o,f,c){return r||(r=o),l+=n.slice(a,c).replace($,i),e&&(l+="'+__e("+e+")+'"),f&&(u=true,l+="';"+f+";\n__p+='"),r&&(l+="'+((__t=("+r+"))==null?'':__t)+'"),a=c+t.length,t +}),l+="';",f=e=e.variable,f||(e="obj",l="with("+e+"){"+l+"}"),l=(u?l.replace(w,""):l).replace(j,"$1").replace(k,"$1;"),l="function("+e+"){"+(f?"":e+"||("+e+"={});")+"var __t,__p='',__e=_.escape"+(u?",__j=Array.prototype.join;function print(){__p+=__j.call(arguments,'')}":";")+l+"return __p}";try{var c=ie(r,"return "+l).apply(v,o)}catch(p){throw p.source=l,p}return t?c(t):(c.source=l,c)},d.unescape=function(n){return null==n?"":(n=pe(n),0>n.indexOf(";")?n:n.replace(R,bt))},d.uniqueId=function(n){var t=++y; +return pe(null==n?"":n)+t},d.all=Tt,d.any=Kt,d.detect=Dt,d.findWhere=Dt,d.foldl=Wt,d.foldr=zt,d.include=St,d.inject=Wt,Zt(function(){var n={};return jt(d,function(t,e){d.prototype[e]||(n[e]=t)}),n}(),false),d.first=Lt,d.last=function(n,t,e){var r=0,u=n?n.length:0;if(typeof t!="number"&&null!=t){var o=u;for(t=d.createCallback(t,e,3);o--&&t(n[o],o,n);)r++}else if(r=t,null==r||e)return n?n[u-1]:v;return p(n,Be(0,u-r))},d.sample=function(n,t,e){return n&&typeof n.length!="number"&&(n=Rt(n)),null==t||e?n?n[ct(0,n.length-1)]:v:(n=Pt(n),n.length=qe(Be(0,t),n.length),n) +},d.take=Lt,d.head=Lt,jt(d,function(n,t){var e="sample"!==t;d.prototype[t]||(d.prototype[t]=function(t,r){var u=this.__chain__,o=n(this.__wrapped__,t,r);return u||null!=t&&(!r||e&&typeof t=="function")?new Y(o,u):o})}),d.VERSION="2.4.1",d.prototype.chain=function(){return this.__chain__=true,this},d.prototype.toString=function(){return pe(this.__wrapped__)},d.prototype.value=ee,d.prototype.valueOf=ee,$t(["join","pop","shift"],function(n){var t=ve[n];d.prototype[n]=function(){var n=this.__chain__,e=t.apply(this.__wrapped__,arguments); +return n?new Y(e,n):e}}),$t(["push","reverse","sort","unshift"],function(n){var t=ve[n];d.prototype[n]=function(){return t.apply(this.__wrapped__,arguments),this}}),$t(["concat","slice","splice"],function(n){var t=ve[n];d.prototype[n]=function(){return new Y(t.apply(this.__wrapped__,arguments),this.__chain__)}}),d}var v,g=[],h=[],y=0,m=+new Date+"",b=75,d=40,_=" \t\x0B\f\xa0\ufeff\n\r\u2028\u2029\u1680\u180e\u2000\u2001\u2002\u2003\u2004\u2005\u2006\u2007\u2008\u2009\u200a\u202f\u205f\u3000",w=/\b__p\+='';/g,j=/\b(__p\+=)''\+/g,k=/(__e\(.*?\)|\b__t\))\+'';/g,x=/\$\{([^\\}]*(?:\\.[^\\}]*)*)\}/g,C=/\w*$/,O=/^\s*function[ \n\r\t]+\w/,E=/<%-([\s\S]+?)%>/g,N=/<%([\s\S]+?)%>/g,I=/<%=([\s\S]+?)%>/g,R=/&(?:amp|lt|gt|quot|#39);/g,S=/[&<>"']/g,T=RegExp("^["+_+"]*0+(?=.$)"),A=/($^)/,D=/\bthis\b/,$=/['\n\r\t\u2028\u2029\\]/g,F="Array Boolean Date Function Math Number Object RegExp String _ clearTimeout document isFinite isNaN parseInt setTimeout TypeError window WinRTError".split(" "),B="[object Arguments]",q="[object Array]",W="[object Boolean]",z="[object Date]",P="[object Function]",K="[object Number]",L="[object Object]",M="[object RegExp]",V="[object String]",U={}; +U[P]=false,U[B]=U[q]=U[W]=U[z]=U[K]=U[L]=U[M]=U[V]=true;var G={leading:false,maxWait:0,trailing:false},H={configurable:false,enumerable:false,value:null,writable:false},J={"&":"&","<":"<",">":">",'"':""","'":"'"},Q={"&":"&","<":"<",">":">",""":'"',"'":"'"},X={"boolean":false,"function":true,object:true,number:false,string:false,undefined:false},Y={"\\":"\\","'":"'","\n":"n","\r":"r","\t":"t","\u2028":"u2028","\u2029":"u2029"},Z=X[typeof window]&&window||this,nt=X[typeof exports]&&exports&&!exports.nodeType&&exports,tt=X[typeof global]&&global; +!tt||tt.global!==tt&&tt.window!==tt||(Z=tt);var et=(tt=X[typeof module]&&module&&!module.nodeType&&module)&&tt.exports===nt&&nt,rt=s();typeof define=="function"&&typeof define.amd=="object"&&define.amd?(Z._=rt, define(function(){return rt})):nt&&tt?et?(tt.exports=rt)._=rt:nt._=rt:Z._=rt}).call(this); \ No newline at end of file diff --git a/dist/lodash.underscore.js b/dist/lodash.underscore.js index e8117bd4d..fb7be599a 100644 --- a/dist/lodash.underscore.js +++ b/dist/lodash.underscore.js @@ -26,6 +26,10 @@ reEvaluate = /<%([\s\S]+?)%>/g, reInterpolate = /<%=([\s\S]+?)%>/g; + /** Used to match HTML entities and HTML characters */ + var reEscapedHtml = /&(?:amp|lt|gt|quot|#39);/g, + reUnescapedHtml = /[&<>"']/g; + /** Used to ensure capturing order of template delimiters */ var reNoMatch = /($^)/; @@ -43,6 +47,31 @@ regexpClass = '[object RegExp]', stringClass = '[object String]'; + /** + * Used to convert characters to HTML entities: + * + * Though the `>` character is escaped for symmetry, characters like `>` and `/` + * don't require escaping in HTML and have no special meaning unless they're part + * of a tag or an unquoted attribute value. + * http://mathiasbynens.be/notes/ambiguous-ampersands (under "semi-related fun fact") + */ + var htmlEscapes = { + '&': '&', + '<': '<', + '>': '>', + '"': '"', + "'": ''' + }; + + /** Used to convert HTML entities to characters */ + var htmlUnescapes = { + '&': '&', + '<': '<', + '>': '>', + '"': '"', + ''': "'" + }; + /** Used to determine if values are of the language type Object */ var objectTypes = { 'boolean': false, @@ -983,29 +1012,6 @@ return nativeKeys(object); }; - /** - * Used to convert characters to HTML entities: - * - * Though the `>` character is escaped for symmetry, characters like `>` and `/` - * don't require escaping in HTML and have no special meaning unless they're part - * of a tag or an unquoted attribute value. - * http://mathiasbynens.be/notes/ambiguous-ampersands (under "semi-related fun fact") - */ - var htmlEscapes = { - '&': '&', - '<': '<', - '>': '>', - '"': '"', - "'": ''' - }; - - /** Used to convert HTML entities to characters */ - var htmlUnescapes = invert(htmlEscapes); - - /** Used to match HTML entities and HTML characters */ - var reEscapedHtml = RegExp('(' + keys(htmlUnescapes).join('|') + ')', 'g'), - reUnescapedHtml = RegExp('[' + keys(htmlEscapes).join('') + ']', 'g'); - /*--------------------------------------------------------------------------*/ /** diff --git a/dist/lodash.underscore.min.js b/dist/lodash.underscore.min.js index 5c7055c9a..c6947ea4e 100644 --- a/dist/lodash.underscore.min.js +++ b/dist/lodash.underscore.min.js @@ -3,37 +3,37 @@ * Lo-Dash 2.4.1 (Custom Build) lodash.com/license | Underscore.js 1.5.2 underscorejs.org/LICENSE * Build: `lodash underscore exports="amd,commonjs,global,node" -o ./dist/lodash.underscore.js` */ -;(function(){function n(n,r,t){t=(t||0)-1;for(var e=n?n.length:0;++tf||typeof i=="undefined")return 1;if(it?0:t);++ee(r,i)&&o.push(i)}return o}function p(n,r,t,e){e=(e||0)-1;for(var u=n?n.length:0,o=[];++eu(f,l))&&(t&&f.push(l),i.push(a))}return i}function h(n){return function(r,t,e){var u={};t=Y(t,e,3),e=-1;var o=r?r.length:0;if(typeof o=="number")for(;++eu&&(u=t);else r=Y(r,t,3),D(n,function(n,t,o){t=r(n,t,o),t>e&&(e=t,u=n)});return u}function z(n,r,t,e){if(!n)return t;var u=3>arguments.length;r=Y(r,e,4);var o=-1,i=n.length;if(typeof i=="number")for(u&&(t=n[++o]);++oarguments.length; -return r=Y(r,e,4),I(n,function(n,e,o){t=u?(u=false,n):r(t,n,e,o)}),t}function P(n){var r=-1,t=n?n.length:0,e=Array(typeof t=="number"?t:0);return D(n,function(n){var t;t=++r,t=0+kr(Cr()*(t-0+1)),e[r]=e[t],e[t]=n}),e}function U(n,r,t){var e;r=Y(r,t,3),t=-1;var u=n?n.length:0;if(typeof u=="number")for(;++te?Wr(0,u+e):e||0}else if(e)return e=K(r,t),r[e]===t?e:-1;return n(r,t,e)}function J(n,r,t){if(typeof r!="number"&&null!=r){var u=0,o=-1,i=n?n.length:0;for(r=Y(r,t,3);++o>>1,t(n[e])=y;m?(u&&(u=clearTimeout(u)),c=i,o=n.apply(f,e)):u||(u=setTimeout(v,y))}return m&&a?a=clearTimeout(a):a||r===p||(a=setTimeout(h,r)),t&&(m=true,o=n.apply(f,e)),!m||a||u||(e=f=null),o}}function Y(n,r,t){var e=typeof n;if(null==n||"function"==e)return a(n,r,t);if("object"!=e)return rr(n);var u=Gr(n); -return function(r){for(var t=u.length,e=false;t--&&(e=r[u[t]]===n[u[t]]););return e}}function Z(n){return n}function nr(n){D(T(n),function(r){var t=u[r]=n[r];u.prototype[r]=function(){var n=[this.__wrapped__];return Fr.apply(n,arguments),n=t.apply(u,n),this.__chain__?new o(n,true):n}})}function rr(n){return function(r){return r[n]}}var tr,er=0,ur={},or=+new Date+"",ir=/($^)/,fr=/['\n\r\t\u2028\u2029\\]/g,ar="[object Arguments]",lr="[object Array]",cr="[object Boolean]",pr="[object Date]",sr="[object Number]",gr="[object Object]",hr="[object RegExp]",vr="[object String]",yr={"boolean":false,"function":true,object:true,number:false,string:false,undefined:false},mr={"\\":"\\","'":"'","\n":"n","\r":"r","\t":"t","\u2028":"u2028","\u2029":"u2029"},_r=yr[typeof window]&&window||this,dr=yr[typeof exports]&&exports&&!exports.nodeType&&exports,br=yr[typeof global]&&global; -!br||br.global!==br&&br.window!==br||(_r=br);var wr=yr[typeof module]&&module&&!module.nodeType&&module,jr=wr&&wr.exports===dr&&dr,xr=[],Tr=Object.prototype,Er=_r._,Ar=Tr.toString,Or=RegExp("^"+(Ar+"").replace(/[.*+?^${}()|[\]\\]/g,"\\$&").replace(/toString|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),Sr=Math.ceil,kr=Math.floor,Nr=Function.prototype.toString,Rr=Tr.hasOwnProperty,Fr=xr.push,Br=Tr.propertyIsEnumerable,$r=_($r=Object.create)&&$r,qr=_(qr=Array.isArray)&&qr,Dr=_r.isFinite,Ir=_r.isNaN,Mr=_(Mr=Object.keys)&&Mr,Wr=Math.max,zr=Math.min,Cr=Math.random; -o.prototype=u.prototype;var Pr={};!function(){var n={0:1,length:1};Pr.spliceObjects=(xr.splice.call(n,0,1),!n[0])}(1),u.templateSettings={escape:/<%-([\s\S]+?)%>/g,evaluate:/<%([\s\S]+?)%>/g,interpolate:/<%=([\s\S]+?)%>/g,variable:""},$r||(f=function(){function n(){}return function(r){if(S(r)){n.prototype=r;var t=new n;n.prototype=null}return t||_r.Object()}}()),b(arguments)||(b=function(n){return n&&typeof n=="object"&&typeof n.length=="number"&&Rr.call(n,"callee")&&!Br.call(n,"callee")||false});var Ur=qr||function(n){return n&&typeof n=="object"&&typeof n.length=="number"&&Ar.call(n)==lr||false -},Vr=function(n){var r=[];if(!n||!yr[typeof n])return r;for(var t in n)Rr.call(n,t)&&r.push(t);return r},Gr=Mr?function(n){return S(n)?Mr(n):[]}:Vr,Hr={"&":"&","<":"<",">":">",'"':""","'":"'"},Jr=E(Hr),Kr=RegExp("("+Gr(Jr).join("|")+")","g"),Lr=RegExp("["+Gr(Hr).join("")+"]","g"),Qr=function(n,r){if(!n||!yr[typeof n])return n;for(var t in n)if(r(n[t],t,n)===ur)break;return n};O(/x/)&&(O=function(n){return typeof n=="function"&&"[object Function]"==Ar.call(n)});var Xr=h(function(n,r,t){Rr.call(n,t)?n[t]++:n[t]=1 -}),Yr=h(function(n,r,t){(Rr.call(n,t)?n[t]:n[t]=[]).push(r)}),Zr=h(function(n,r,t){n[t]=r}),nt=M,rt=_(rt=Date.now)&&rt||function(){return(new Date).getTime()};u.after=function(n,r){if(!O(r))throw new TypeError;return function(){return 1>--n?r.apply(this,arguments):void 0}},u.bind=Q,u.bindAll=function(n){for(var r=1i(a,e)){for(r=t;--r;)if(0>i(n[r],e))continue n; -a.push(e)}return a},u.invert=E,u.invoke=function(n,r){var t=e(arguments,2),u=-1,o=typeof r=="function",i=n?n.length:0,f=Array(typeof i=="number"?i:0);return D(n,function(n){f[++u]=(o?r:n[r]).apply(n,t)}),f},u.keys=Gr,u.map=M,u.max=W,u.memoize=function(n,r){var t={};return function(){var e=r?r.apply(this,arguments):or+arguments[0];return Rr.call(t,e)?t[e]:t[e]=n.apply(this,arguments)}},u.min=function(n,r,t){var e=1/0,u=e;typeof r!="function"&&t&&t[r]===n&&(r=null);var o=-1,i=n?n.length:0;if(null==r&&typeof i=="number")for(;++or?0:r);++nt?Wr(0,e+t):zr(t,e-1))+1);e--;)if(n[e]===r)return e;return-1},u.mixin=nr,u.noConflict=function(){return _r._=Er,this},u.random=function(n,r){return null==n&&null==r&&(r=1),n=+n||0,null==r?(r=n,n=0):r=+r||0,n+kr(Cr()*(r-n+1)) -},u.reduce=z,u.reduceRight=C,u.result=function(n,r){if(n){var t=n[r];return O(t)?n[r]():t}},u.size=function(n){var r=n?n.length:0;return typeof r=="number"?r:Gr(n).length},u.some=U,u.sortedIndex=K,u.template=function(n,r,e){var o=u,i=o.templateSettings;n=(n||"")+"",e=j({},e,i);var f=0,a="__p+='",i=e.variable;n.replace(RegExp((e.escape||ir).source+"|"+(e.interpolate||ir).source+"|"+(e.evaluate||ir).source+"|$","g"),function(r,e,u,o,i){return a+=n.slice(f,i).replace(fr,t),e&&(a+="'+_.escape("+e+")+'"),o&&(a+="';"+o+";\n__p+='"),u&&(a+="'+((__t=("+u+"))==null?'':__t)+'"),f=i+r.length,r -}),a+="';",i||(i="obj",a="with("+i+"||{}){"+a+"}"),a="function("+i+"){var __t,__p='',__j=Array.prototype.join;function print(){__p+=__j.call(arguments,'')}"+a+"return __p}";try{var l=Function("_","return "+a)(o)}catch(c){throw c.source=a,c}return r?l(r):(l.source=a,l)},u.unescape=function(n){return null==n?"":(n+="",0>n.indexOf(";")?n:n.replace(Kr,d))},u.uniqueId=function(n){var r=++er+"";return n?n+r:r},u.all=B,u.any=U,u.detect=q,u.findWhere=function(n,r){return V(n,r,true)},u.foldl=z,u.foldr=C,u.include=F,u.inject=z,u.first=G,u.last=function(n,r,t){var u=0,o=n?n.length:0; -if(typeof r!="number"&&null!=r){var i=o;for(r=Y(r,t,3);i--&&r(n[i],i,n);)u++}else if(u=r,null==u||t)return n?n[o-1]:tr;return e(n,Wr(0,o-u))},u.sample=function(n,r,t){return n&&typeof n.length!="number"&&(n=R(n)),null==r||t?n?n[0+kr(Cr()*(n.length-1-0+1))]:tr:(n=P(n),n.length=zr(Wr(0,r),n.length),n)},u.take=G,u.head=G,nr(w({},u)),u.VERSION="2.4.1",u.prototype.chain=function(){return this.__chain__=true,this},u.prototype.value=function(){return this.__wrapped__},D("pop push reverse shift sort splice unshift".split(" "),function(n){var r=xr[n]; -u.prototype[n]=function(){var n=this.__wrapped__;return r.apply(n,arguments),Pr.spliceObjects||0!==n.length||delete n[0],this}}),D(["concat","join","slice"],function(n){var r=xr[n];u.prototype[n]=function(){var n=r.apply(this.__wrapped__,arguments);return this.__chain__&&(n=new o(n),n.__chain__=true),n}}),typeof define=="function"&&typeof define.amd=="object"&&define.amd?(_r._=u, define(function(){return u})):dr&&wr?jr?(wr.exports=u)._=u:dr._=u:_r._=u}).call(this); \ No newline at end of file +;(function(){function n(n,r,t){t=(t||0)-1;for(var e=n?n.length:0;++tf||typeof i=="undefined")return 1;if(it?0:t);++ee(r,i)&&o.push(i)}return o}function p(n,r,t,e){e=(e||0)-1;for(var u=n?n.length:0,o=[];++eu(f,l))&&(t&&f.push(l),i.push(a))}return i}function h(n){return function(r,t,e){var u={};t=X(t,e,3),e=-1;var o=r?r.length:0;if(typeof o=="number")for(;++eu&&(u=t); +else r=X(r,t,3),$(n,function(n,t,o){t=r(n,t,o),t>e&&(e=t,u=n)});return u}function W(n,r,t,e){if(!n)return t;var u=3>arguments.length;r=X(r,e,4);var o=-1,i=n.length;if(typeof i=="number")for(u&&(t=n[++o]);++oarguments.length;return r=X(r,e,4),D(n,function(n,e,o){t=u?(u=false,n):r(t,n,e,o)}),t}function C(n){var r=-1,t=n?n.length:0,e=Array(typeof t=="number"?t:0);return $(n,function(n){var t;t=++r,t=0+Fr(Vr()*(t-0+1)),e[r]=e[t],e[t]=n +}),e}function P(n,r,t){var e;r=X(r,t,3),t=-1;var u=n?n.length:0;if(typeof u=="number")for(;++te?Pr(0,u+e):e||0}else if(e)return e=J(r,t),r[e]===t?e:-1; +return n(r,t,e)}function H(n,r,t){if(typeof r!="number"&&null!=r){var u=0,o=-1,i=n?n.length:0;for(r=X(r,t,3);++o>>1,t(n[e])=y;m?(u&&(u=clearTimeout(u)),c=i,o=n.apply(f,e)):u||(u=setTimeout(v,y))}return m&&a?a=clearTimeout(a):a||r===p||(a=setTimeout(h,r)),t&&(m=true,o=n.apply(f,e)),!m||a||u||(e=f=null),o}}function X(n,r,t){var e=typeof n;if(null==n||"function"==e)return a(n,r,t);if("object"!=e)return nr(n);var u=Kr(n);return function(r){for(var t=u.length,e=false;t--&&(e=r[u[t]]===n[u[t]]););return e}}function Y(n){return n}function Z(n){$(T(n),function(r){var t=u[r]=n[r];u.prototype[r]=function(){var n=[this.__wrapped__]; +return $r.apply(n,arguments),n=t.apply(u,n),this.__chain__?new o(n,true):n}})}function nr(n){return function(r){return r[n]}}var rr,tr=0,er={},ur=+new Date+"",or=/&(?:amp|lt|gt|quot|#39);/g,ir=/[&<>"']/g,fr=/($^)/,ar=/['\n\r\t\u2028\u2029\\]/g,lr="[object Arguments]",cr="[object Array]",pr="[object Boolean]",sr="[object Date]",gr="[object Number]",hr="[object Object]",vr="[object RegExp]",yr="[object String]",mr={"&":"&","<":"<",">":">",'"':""","'":"'"},_r={"&":"&","<":"<",">":">",""":'"',"'":"'"},dr={"boolean":false,"function":true,object:true,number:false,string:false,undefined:false},br={"\\":"\\","'":"'","\n":"n","\r":"r","\t":"t","\u2028":"u2028","\u2029":"u2029"},wr=dr[typeof window]&&window||this,jr=dr[typeof exports]&&exports&&!exports.nodeType&&exports,xr=dr[typeof global]&&global; +!xr||xr.global!==xr&&xr.window!==xr||(wr=xr);var Tr=dr[typeof module]&&module&&!module.nodeType&&module,Ar=Tr&&Tr.exports===jr&&jr,Er=[],Or=Object.prototype,Sr=wr._,kr=Or.toString,Nr=RegExp("^"+(kr+"").replace(/[.*+?^${}()|[\]\\]/g,"\\$&").replace(/toString|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),qr=Math.ceil,Fr=Math.floor,Br=Function.prototype.toString,Rr=Or.hasOwnProperty,$r=Er.push,Dr=Or.propertyIsEnumerable,Ir=_(Ir=Object.create)&&Ir,Mr=_(Mr=Array.isArray)&&Mr,Wr=wr.isFinite,zr=wr.isNaN,Cr=_(Cr=Object.keys)&&Cr,Pr=Math.max,Ur=Math.min,Vr=Math.random; +o.prototype=u.prototype;var Gr={};!function(){var n={0:1,length:1};Gr.spliceObjects=(Er.splice.call(n,0,1),!n[0])}(1),u.templateSettings={escape:/<%-([\s\S]+?)%>/g,evaluate:/<%([\s\S]+?)%>/g,interpolate:/<%=([\s\S]+?)%>/g,variable:""},Ir||(f=function(){function n(){}return function(r){if(O(r)){n.prototype=r;var t=new n;n.prototype=null}return t||wr.Object()}}()),b(arguments)||(b=function(n){return n&&typeof n=="object"&&typeof n.length=="number"&&Rr.call(n,"callee")&&!Dr.call(n,"callee")||false});var Hr=Mr||function(n){return n&&typeof n=="object"&&typeof n.length=="number"&&kr.call(n)==cr||false +},Jr=function(n){var r=[];if(!n||!dr[typeof n])return r;for(var t in n)Rr.call(n,t)&&r.push(t);return r},Kr=Cr?function(n){return O(n)?Cr(n):[]}:Jr,Lr=function(n,r){if(!n||!dr[typeof n])return n;for(var t in n)if(r(n[t],t,n)===er)break;return n};E(/x/)&&(E=function(n){return typeof n=="function"&&"[object Function]"==kr.call(n)});var Qr=h(function(n,r,t){Rr.call(n,t)?n[t]++:n[t]=1}),Xr=h(function(n,r,t){(Rr.call(n,t)?n[t]:n[t]=[]).push(r)}),Yr=h(function(n,r,t){n[t]=r}),Zr=I,nt=_(nt=Date.now)&&nt||function(){return(new Date).getTime() +};u.after=function(n,r){if(!E(r))throw new TypeError;return function(){return 1>--n?r.apply(this,arguments):void 0}},u.bind=L,u.bindAll=function(n){for(var r=1i(a,e)){for(r=t;--r;)if(0>i(n[r],e))continue n;a.push(e)}return a},u.invert=function(n,r){for(var t=-1,e=Kr(n),u=e.length,o={};++tr?0:r);++nt?Pr(0,e+t):Ur(t,e-1))+1);e--;)if(n[e]===r)return e;return-1},u.mixin=Z,u.noConflict=function(){return wr._=Sr,this},u.random=function(n,r){return null==n&&null==r&&(r=1),n=+n||0,null==r?(r=n,n=0):r=+r||0,n+Fr(Vr()*(r-n+1)) +},u.reduce=W,u.reduceRight=z,u.result=function(n,r){if(n){var t=n[r];return E(t)?n[r]():t}},u.size=function(n){var r=n?n.length:0;return typeof r=="number"?r:Kr(n).length},u.some=P,u.sortedIndex=J,u.template=function(n,r,e){var o=u,i=o.templateSettings;n=(n||"")+"",e=j({},e,i);var f=0,a="__p+='",i=e.variable;n.replace(RegExp((e.escape||fr).source+"|"+(e.interpolate||fr).source+"|"+(e.evaluate||fr).source+"|$","g"),function(r,e,u,o,i){return a+=n.slice(f,i).replace(ar,t),e&&(a+="'+_.escape("+e+")+'"),o&&(a+="';"+o+";\n__p+='"),u&&(a+="'+((__t=("+u+"))==null?'':__t)+'"),f=i+r.length,r +}),a+="';",i||(i="obj",a="with("+i+"||{}){"+a+"}"),a="function("+i+"){var __t,__p='',__j=Array.prototype.join;function print(){__p+=__j.call(arguments,'')}"+a+"return __p}";try{var l=Function("_","return "+a)(o)}catch(c){throw c.source=a,c}return r?l(r):(l.source=a,l)},u.unescape=function(n){return null==n?"":(n+="",0>n.indexOf(";")?n:n.replace(or,d))},u.uniqueId=function(n){var r=++tr+"";return n?n+r:r},u.all=F,u.any=P,u.detect=R,u.findWhere=function(n,r){return U(n,r,true)},u.foldl=W,u.foldr=z,u.include=q,u.inject=W,u.first=V,u.last=function(n,r,t){var u=0,o=n?n.length:0; +if(typeof r!="number"&&null!=r){var i=o;for(r=X(r,t,3);i--&&r(n[i],i,n);)u++}else if(u=r,null==u||t)return n?n[o-1]:rr;return e(n,Pr(0,o-u))},u.sample=function(n,r,t){return n&&typeof n.length!="number"&&(n=N(n)),null==r||t?n?n[0+Fr(Vr()*(n.length-1-0+1))]:rr:(n=C(n),n.length=Ur(Pr(0,r),n.length),n)},u.take=V,u.head=V,Z(w({},u)),u.VERSION="2.4.1",u.prototype.chain=function(){return this.__chain__=true,this},u.prototype.value=function(){return this.__wrapped__},$("pop push reverse shift sort splice unshift".split(" "),function(n){var r=Er[n]; +u.prototype[n]=function(){var n=this.__wrapped__;return r.apply(n,arguments),Gr.spliceObjects||0!==n.length||delete n[0],this}}),$(["concat","join","slice"],function(n){var r=Er[n];u.prototype[n]=function(){var n=r.apply(this.__wrapped__,arguments);return this.__chain__&&(n=new o(n),n.__chain__=true),n}}),typeof define=="function"&&typeof define.amd=="object"&&define.amd?(wr._=u, define(function(){return u})):jr&&Tr?Ar?(Tr.exports=u)._=u:jr._=u:wr._=u}).call(this); \ No newline at end of file diff --git a/lodash.js b/lodash.js index 74f912926..07d835239 100644 --- a/lodash.js +++ b/lodash.js @@ -64,6 +64,10 @@ reEvaluate = /<%([\s\S]+?)%>/g, reInterpolate = /<%=([\s\S]+?)%>/g; + /** Used to match HTML entities and HTML characters */ + var reEscapedHtml = /&(?:amp|lt|gt|quot|#39);/g, + reUnescapedHtml = /[&<>"']/g; + /** Used to match leading whitespace and zeros to be removed */ var reLeadingSpacesAndZeros = RegExp('^[' + whitespace + ']*0+(?=.$)'); @@ -127,6 +131,31 @@ 'writable': false }; + /** + * Used to convert characters to HTML entities: + * + * Though the `>` character is escaped for symmetry, characters like `>` and `/` + * don't require escaping in HTML and have no special meaning unless they're part + * of a tag or an unquoted attribute value. + * http://mathiasbynens.be/notes/ambiguous-ampersands (under "semi-related fun fact") + */ + var htmlEscapes = { + '&': '&', + '<': '<', + '>': '>', + '"': '"', + "'": ''' + }; + + /** Used to convert HTML entities to characters */ + var htmlUnescapes = { + '&': '&', + '<': '<', + '>': '>', + '"': '"', + ''': "'" + }; + /** Used to determine if values are of the language type Object */ var objectTypes = { 'boolean': false, @@ -1965,29 +1994,6 @@ return nativeKeys(object); }; - /** - * Used to convert characters to HTML entities: - * - * Though the `>` character is escaped for symmetry, characters like `>` and `/` - * don't require escaping in HTML and have no special meaning unless they're part - * of a tag or an unquoted attribute value. - * http://mathiasbynens.be/notes/ambiguous-ampersands (under "semi-related fun fact") - */ - var htmlEscapes = { - '&': '&', - '<': '<', - '>': '>', - '"': '"', - "'": ''' - }; - - /** Used to convert HTML entities to characters */ - var htmlUnescapes = invert(htmlEscapes); - - /** Used to match HTML entities and HTML characters */ - var reEscapedHtml = RegExp('(' + keys(htmlUnescapes).join('|') + ')', 'g'), - reUnescapedHtml = RegExp('[' + keys(htmlEscapes).join('') + ']', 'g'); - /*--------------------------------------------------------------------------*/ /**