Escape a few more characters for in _.escapeRegExp for better narwhal/ringo/rhino support.

This commit is contained in:
John-David Dalton
2014-03-03 09:18:49 -08:00
parent e22b2f00dc
commit 5695e0e6b6
7 changed files with 11 additions and 11 deletions

View File

@@ -63,6 +63,6 @@ n.replace(f,function(t,r,e,u,i,f){return e||(e=u),c+=n.slice(l,f).replace(V,s),r
r=r.slice(0,null==i?o:i)}}else n.indexOf(u,o)!=o&&(u=r.lastIndexOf(u),-1<u&&(r=r.slice(0,u)));return r+e},u.unescape=function(n){return null==n?"":(n=Or(n),0>n.indexOf(";")?n:n.replace(T,d))},u.uniqueId=function(n){var t=++S;return Or(null==n?"":n)+t},u.all=Bt,u.any=Jt,u.detect=Ut,u.findWhere=Ut,u.foldl=Yt,u.foldr=Gt,u.include=Wt,u.inject=Yt,vr(function(){var n={};return ht(u,function(t,r){u.prototype[r]||(n[r]=t)}),n}(),false),u.first=Rt,u.last=function(n,t,r){var e=n?n.length:0;if(typeof t!="number"&&null!=t){var o=e,a=0;
for(t=u.createCallback(t,r,3);o--&&t(n[o],o,n);)a++}else if(a=t,null==a||r)return n?n[e-1]:_;return a=e-a,Lt(n,0<a?a:0)},u.sample=function(n,t,r){return n&&typeof n.length!="number"?n=fr(n):se.unindexedChars&&lr(n)&&(n=n.split("")),null==t||r?n?n[_t(0,n.length-1)]:_:(n=Ht(n),n.length=re(te(0,t),n.length),n)},u.take=Rt,u.head=Rt,ht(u,function(n,t){var r="sample"!==t;u.prototype[t]||(u.prototype[t]=function(t,e){var u=this.__chain__,a=n(this.__wrapped__,t,e);return u||null!=t&&(!e||r&&typeof t=="function")?new o(a,u):a
})}),u.VERSION=E,u.prototype.chain=function(){return this.__chain__=true,this},u.prototype.toString=function(){return Or(this.__wrapped__)},u.prototype.value=Dt,u.prototype.valueOf=Dt,st(["join","pop","shift"],function(n){var t=Ar[n];u.prototype[n]=function(){var n=this.__chain__,r=t.apply(this.__wrapped__,arguments);return n?new o(r,n):r}}),st(["push","reverse","sort","unshift"],function(n){var t=Ar[n];u.prototype[n]=function(){return t.apply(this.__wrapped__,arguments),this}}),st(["concat","splice"],function(n){var t=Ar[n];
u.prototype[n]=function(){return new o(t.apply(this.__wrapped__,arguments),this.__chain__)}}),se.spliceObjects||st(["pop","shift","splice"],function(n){var t=Ar[n],r="splice"==n;u.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 o(u,n):u}}),u}var _,w=1,x=2,C=4,j=8,k=16,O=32,E="2.4.1",A="__lodash@"+E+"__",S=0,I=/\b__p\+='';/g,R=/\b(__p\+=)''\+/g,N=/(__e\(.*?\)|\b__t\))\+'';/g,T=/&(?:amp|lt|gt|quot|#39);/g,L=/[&<>"']/g,P=/<%-([\s\S]+?)%>/g,F=/<%([\s\S]+?)%>/g,q=/<%=([\s\S]+?)%>/g,$=/\$\{([^\\}]*(?:\\.[^\\}]*)*)\}/g,D=/\w*$/,W=/^\s*function[ \n\r\t]+\w/,B=/^0[xX]/,z=/[\xC0-\xFF]/g,U=/($^)/,K=/[.*+?^${()|[\\]/g,M=/\bthis\b/,V=/['\n\r\t\u2028\u2029\\]/g,X=/[a-z0-9]+/g,Y=" \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",G="Array Boolean Date Error Function Math Number Object RegExp Set String _ clearTimeout document isFinite isNaN parseInt setTimeout TypeError window WinRTError".split(" "),H="constructor hasOwnProperty isPrototypeOf propertyIsEnumerable toLocaleString toString valueOf".split(" "),J="[object Arguments]",Q="[object Array]",Z="[object Boolean]",nt="[object Date]",tt="[object Error]",rt="[object Function]",et="[object Number]",ut="[object Object]",ot="[object RegExp]",at="[object String]",it={};
u.prototype[n]=function(){return new o(t.apply(this.__wrapped__,arguments),this.__chain__)}}),se.spliceObjects||st(["pop","shift","splice"],function(n){var t=Ar[n],r="splice"==n;u.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 o(u,n):u}}),u}var _,w=1,x=2,C=4,j=8,k=16,O=32,E="2.4.1",A="__lodash@"+E+"__",S=0,I=/\b__p\+='';/g,R=/\b(__p\+=)''\+/g,N=/(__e\(.*?\)|\b__t\))\+'';/g,T=/&(?:amp|lt|gt|quot|#39);/g,L=/[&<>"']/g,P=/<%-([\s\S]+?)%>/g,F=/<%([\s\S]+?)%>/g,q=/<%=([\s\S]+?)%>/g,$=/\$\{([^\\}]*(?:\\.[^\\}]*)*)\}/g,D=/\w*$/,W=/^\s*function[ \n\r\t]+\w/,B=/^0[xX]/,z=/[\xC0-\xFF]/g,U=/($^)/,K=/[.*+?^${}()|[\]\\]/g,M=/\bthis\b/,V=/['\n\r\t\u2028\u2029\\]/g,X=/[a-z0-9]+/g,Y=" \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",G="Array Boolean Date Error Function Math Number Object RegExp Set String _ clearTimeout document isFinite isNaN parseInt setTimeout TypeError window WinRTError".split(" "),H="constructor hasOwnProperty isPrototypeOf propertyIsEnumerable toLocaleString toString valueOf".split(" "),J="[object Arguments]",Q="[object Array]",Z="[object Boolean]",nt="[object Date]",tt="[object Error]",rt="[object Function]",et="[object Number]",ut="[object Object]",ot="[object RegExp]",at="[object String]",it={};
it[rt]=false,it[J]=it[Q]=it[Z]=it[nt]=it[et]=it[ut]=it[ot]=it[at]=true;var lt={leading:false,maxWait:0,trailing:false},ft={configurable:false,enumerable:false,value:null,writable:false},ct={"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#39;"},st={"&amp;":"&","&lt;":"<","&gt;":">","&quot;":'"',"&#39;":"'"},pt={\u00c0:"A",\u00c1:"A",\u00c2:"A",\u00c3:"A",\u00c4:"A",\u00c5:"A",\u00e0:"a",\u00e1:"a",\u00e2:"a",\u00e3:"a",\u00e4:"a",\u00e5:"a",\u00c7:"C",\u00e7:"c",\u00d0:"D",\u00f0:"d",\u00c8:"E",\u00c9:"E",\u00ca:"E",\u00cb:"E",\u00e8:"e",\u00e9:"e",\u00ea:"e",\u00eb:"e",\u00cc:"I",\u00cd:"I",\u00ce:"I",\u00cf:"I",\u00ec:"i",\u00ed:"i",\u00ee:"i",\u00ef:"i",\u00d1:"N",\u00f1:"n",\u00d2:"O",\u00d3:"O",\u00d4:"O",\u00d5:"O",\u00d6:"O",\u00d8:"O",\u00f2:"o",\u00f3:"o",\u00f4:"o",\u00f5:"o",\u00f6:"o",\u00f8:"o",\u00d9:"U",\u00da:"U",\u00db:"U",\u00dc:"U",\u00f9:"u",\u00fa:"u",\u00fb:"u",\u00fc:"u",\u00dd:"Y",\u00fd:"y",\u00ff:"y",\u00c6:"AE",\u00e6:"ae",\u00de:"Th",\u00fe:"th",\u00df:"ss","\xd7":"","\xf7":""},gt={"function":true,object:true},ht={"\\":"\\","'":"'","\n":"n","\r":"r","\t":"t","\u2028":"u2028","\u2029":"u2029"},vt=gt[typeof window]&&window||this,yt=gt[typeof exports]&&exports&&!exports.nodeType&&exports,gt=gt[typeof module]&&module&&!module.nodeType&&module,mt=yt&&gt&&typeof global=="object"&&global;
!mt||mt.global!==mt&&mt.window!==mt&&mt.self!==mt||(vt=mt);var mt=gt&&gt.exports===yt&&yt,dt=b();typeof define=="function"&&typeof define.amd=="object"&&define.amd?(vt._=dt, define(function(){return dt})):yt&&gt?mt?(gt.exports=dt)._=dt:yt._=dt:vt._=dt}).call(this);