underscore
Advanced tools
Comparing version 1.8.0 to 1.8.1
@@ -18,3 +18,3 @@ { | ||
"main": "underscore.js", | ||
"version": "1.8.0", | ||
"version": "1.8.1", | ||
"devDependencies": { | ||
@@ -21,0 +21,0 @@ "docco": "0.6.x", |
@@ -1,6 +0,6 @@ | ||
// Underscore.js 1.8.0 | ||
// Underscore.js 1.8.1 | ||
// http://underscorejs.org | ||
// (c) 2009-2015 Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors | ||
// Underscore may be freely distributed under the MIT license. | ||
(function(){function n(n){function t(t,r,e,u,i,o){for(;i>=0&&o>i;i+=n){var a=u?u[i]:i;e=r(e,t[a],a,t)}return e}return function(r,e,u,i){e=d(e,i,4);var o=!w(r)&&m.keys(r),a=(o||r).length,c=n>0?0:a-1;return arguments.length<3&&(u=r[o?o[c]:c],c+=n),t(r,e,u,o,c,a)}}function t(n){return function(t,r,e){r=b(r,e);for(var u=null!=t&&t.length,i=n>0?0:u-1;i>=0&&u>i;i+=n)if(r(t[i],i,t))return i;return-1}}function r(n,t){for(var r=F.length,e="function"==typeof n.constructor?a:o;r--;){var u=F[r];("constructor"===u?m.has(n,u):u in n&&n[u]!==e[u]&&!m.contains(t,u))&&t.push(u)}}var e=this,u=e._,i=Array.prototype,o=Object.prototype,a=Function.prototype,c=i.push,f=i.slice,l=o.toString,s=o.hasOwnProperty,p=Array.isArray,h=Object.keys,v=a.bind,g=Object.create,y=function(){},m=function(n){return n instanceof m?n:this instanceof m?void(this._wrapped=n):new m(n)};"undefined"!=typeof exports?("undefined"!=typeof module&&module.exports&&(exports=module.exports=m),exports._=m):e._=m,m.VERSION="1.8.0";var d=function(n,t,r){if(t===void 0)return n;switch(null==r?3: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,i){return n.call(t,r,e,u,i)}}return function(){return n.apply(t,arguments)}},b=function(n,t,r){return null==n?m.identity:m.isFunction(n)?d(n,t,r):m.isObject(n)?m.matcher(n):m.property(n)};m.iteratee=function(n,t){return b(n,t,1/0)};var x=function(n,t){return function(r){var e=arguments.length;if(2>e||null==r)return r;for(var u=1;e>u;u++)for(var i=arguments[u],o=n(i),a=o.length,c=0;a>c;c++){var f=o[c];t&&r[f]!==void 0||(r[f]=i[f])}return r}},_=function(n){if(!m.isObject(n))return{};if(g)return g(n);y.prototype=n;var t=new y;return y.prototype=null,t},j=Math.pow(2,53)-1,w=function(n){var t=n&&n.length;return"number"==typeof t&&t>=0&&j>=t};m.each=m.forEach=function(n,t,r){t=d(t,r);var e,u;if(w(n))for(e=0,u=n.length;u>e;e++)t(n[e],e,n);else{var i=m.keys(n);for(e=0,u=i.length;u>e;e++)t(n[i[e]],i[e],n)}return n},m.map=m.collect=function(n,t,r){t=b(t,r);for(var e=!w(n)&&m.keys(n),u=(e||n).length,i=Array(u),o=0;u>o;o++){var a=e?e[o]:o;i[o]=t(n[a],a,n)}return i},m.reduce=m.foldl=m.inject=n(1),m.reduceRight=m.foldr=n(-1),m.find=m.detect=function(n,t,r){var e;return e=w(n)?m.findIndex(n,t,r):m.findKey(n,t,r),e!==void 0&&e!==-1?n[e]:void 0},m.filter=m.select=function(n,t,r){var e=[];return t=b(t,r),m.each(n,function(n,r,u){t(n,r,u)&&e.push(n)}),e},m.reject=function(n,t,r){return m.filter(n,m.negate(b(t)),r)},m.every=m.all=function(n,t,r){t=b(t,r);for(var e=!w(n)&&m.keys(n),u=(e||n).length,i=0;u>i;i++){var o=e?e[i]:i;if(!t(n[o],o,n))return!1}return!0},m.some=m.any=function(n,t,r){t=b(t,r);for(var e=!w(n)&&m.keys(n),u=(e||n).length,i=0;u>i;i++){var o=e?e[i]:i;if(t(n[o],o,n))return!0}return!1},m.contains=m.includes=m.include=function(n,t){return w(n)||(n=m.values(n)),m.indexOf(n,t)>=0},m.invoke=function(n,t){var r=f.call(arguments,2),e=m.isFunction(t);return m.map(n,function(n){var u=e?t:n[t];return null==u?u:u.apply(n,r)})},m.pluck=function(n,t){return m.map(n,m.property(t))},m.where=function(n,t){return m.filter(n,m.matcher(t))},m.findWhere=function(n,t){return m.find(n,m.matcher(t))},m.max=function(n,t,r){var e,u,i=-1/0,o=-1/0;if(null==t&&null!=n){n=w(n)?n:m.values(n);for(var a=0,c=n.length;c>a;a++)e=n[a],e>i&&(i=e)}else t=b(t,r),m.each(n,function(n,r,e){u=t(n,r,e),(u>o||u===-1/0&&i===-1/0)&&(i=n,o=u)});return i},m.min=function(n,t,r){var e,u,i=1/0,o=1/0;if(null==t&&null!=n){n=w(n)?n:m.values(n);for(var a=0,c=n.length;c>a;a++)e=n[a],i>e&&(i=e)}else t=b(t,r),m.each(n,function(n,r,e){u=t(n,r,e),(o>u||1/0===u&&1/0===i)&&(i=n,o=u)});return i},m.shuffle=function(n){for(var t,r=w(n)?n:m.values(n),e=r.length,u=Array(e),i=0;e>i;i++)t=m.random(0,i),t!==i&&(u[i]=u[t]),u[t]=r[i];return u},m.sample=function(n,t,r){return null==t||r?(w(n)||(n=m.values(n)),n[m.random(n.length-1)]):m.shuffle(n).slice(0,Math.max(0,t))},m.sortBy=function(n,t,r){return t=b(t,r),m.pluck(m.map(n,function(n,r,e){return{value:n,index:r,criteria:t(n,r,e)}}).sort(function(n,t){var r=n.criteria,e=t.criteria;if(r!==e){if(r>e||r===void 0)return 1;if(e>r||e===void 0)return-1}return n.index-t.index}),"value")};var A=function(n){return function(t,r,e){var u={};return r=b(r,e),m.each(t,function(e,i){var o=r(e,i,t);n(u,e,o)}),u}};m.groupBy=A(function(n,t,r){m.has(n,r)?n[r].push(t):n[r]=[t]}),m.indexBy=A(function(n,t,r){n[r]=t}),m.countBy=A(function(n,t,r){m.has(n,r)?n[r]++:n[r]=1}),m.toArray=function(n){return n?m.isArray(n)?f.call(n):w(n)?m.map(n,m.identity):m.values(n):[]},m.size=function(n){return null==n?0:w(n)?n.length:m.keys(n).length},m.partition=function(n,t,r){t=b(t,r);var e=[],u=[];return m.each(n,function(n,r,i){(t(n,r,i)?e:u).push(n)}),[e,u]},m.first=m.head=m.take=function(n,t,r){return null==n?void 0:null==t||r?n[0]:m.initial(n,n.length-t)},m.initial=function(n,t,r){return f.call(n,0,Math.max(0,n.length-(null==t||r?1:t)))},m.last=function(n,t,r){return null==n?void 0:null==t||r?n[n.length-1]:m.rest(n,Math.max(0,n.length-t))},m.rest=m.tail=m.drop=function(n,t,r){return f.call(n,null==t||r?1:t)},m.compact=function(n){return m.filter(n,m.identity)};var k=function(n,t,r,e){for(var u=[],i=0,o=e||0,a=n&&n.length;a>o;o++){var c=n[o];if(w(c)&&(m.isArray(c)||m.isArguments(c))){t||(c=k(c,t,r));var f=0,l=c.length;for(u.length+=l;l>f;)u[i++]=c[f++]}else r||(u[i++]=c)}return u};m.flatten=function(n,t){return k(n,t,!1)},m.without=function(n){return m.difference(n,f.call(arguments,1))},m.uniq=m.unique=function(n,t,r,e){if(null==n)return[];m.isBoolean(t)||(e=r,r=t,t=!1),null!=r&&(r=b(r,e));for(var u=[],i=[],o=0,a=n.length;a>o;o++){var c=n[o],f=r?r(c,o,n):c;t?(o&&i===f||u.push(c),i=f):r?m.contains(i,f)||(i.push(f),u.push(c)):m.contains(u,c)||u.push(c)}return u},m.union=function(){return m.uniq(k(arguments,!0,!0))},m.intersection=function(n){if(null==n)return[];for(var t=[],r=arguments.length,e=0,u=n.length;u>e;e++){var i=n[e];if(!m.contains(t,i)){for(var o=1;r>o&&m.contains(arguments[o],i);o++);o===r&&t.push(i)}}return t},m.difference=function(n){var t=k(arguments,!0,!0,1);return m.filter(n,function(n){return!m.contains(t,n)})},m.zip=function(){return m.unzip(arguments)},m.unzip=function(n){for(var t=n&&m.max(n,"length").length||0,r=Array(t),e=0;t>e;e++)r[e]=m.pluck(n,e);return r},m.object=function(n,t){for(var r={},e=0,u=n&&n.length;u>e;e++)t?r[n[e]]=t[e]:r[n[e][0]]=n[e][1];return r},m.indexOf=function(n,t,r){var e=0,u=n&&n.length;if("number"==typeof r)e=0>r?Math.max(0,u+r):r;else if(r&&u)return e=m.sortedIndex(n,t),n[e]===t?e:-1;if(t!==t)return m.findIndex(f.call(n,e),m.isNaN);for(;u>e;e++)if(n[e]===t)return e;return-1},m.lastIndexOf=function(n,t,r){var e=n?n.length:0;if("number"==typeof r&&(e=0>r?e+r+1:Math.min(e,r+1)),t!==t)return m.findLastIndex(f.call(n,0,e),m.isNaN);for(;--e>=0;)if(n[e]===t)return e;return-1},m.findIndex=t(1),m.findLastIndex=t(-1),m.sortedIndex=function(n,t,r,e){r=b(r,e,1);for(var u=r(t),i=0,o=n.length;o>i;){var a=Math.floor((i+o)/2);r(n[a])<u?i=a+1:o=a}return i},m.range=function(n,t,r){arguments.length<=1&&(t=n||0,n=0),r=r||1;for(var e=Math.max(Math.ceil((t-n)/r),0),u=Array(e),i=0;e>i;i++,n+=r)u[i]=n;return u};var O=function(n,t,r,e,u){if(!(e instanceof t))return n.apply(r,u);var i=_(n.prototype),o=n.apply(i,u);return m.isObject(o)?o:i};m.bind=function(n,t){if(v&&n.bind===v)return v.apply(n,f.call(arguments,1));if(!m.isFunction(n))throw new TypeError("Bind must be called on a function");var r=f.call(arguments,2);return function e(){return O(n,e,t,this,r.concat(f.call(arguments)))}},m.partial=function(n){var t=f.call(arguments,1);return function r(){for(var e=0,u=t.length,i=Array(u),o=0;u>o;o++)i[o]=t[o]===m?arguments[e++]:t[o];for(;e<arguments.length;)i.push(arguments[e++]);return O(n,r,this,this,i)}},m.bindAll=function(n){var t,r,e=arguments.length;if(1>=e)throw new Error("bindAll must be passed function names");for(t=1;e>t;t++)r=arguments[t],n[r]=m.bind(n[r],n);return n},m.memoize=function(n,t){var r=function(e){var u=r.cache,i=""+(t?t.apply(this,arguments):e);return m.has(u,i)||(u[i]=n.apply(this,arguments)),u[i]};return r.cache={},r},m.delay=function(n,t){var r=f.call(arguments,2);return setTimeout(function(){return n.apply(null,r)},t)},m.defer=m.partial(m.delay,m,1),m.throttle=function(n,t,r){var e,u,i,o=null,a=0;r||(r={});var c=function(){a=r.leading===!1?0:m.now(),o=null,i=n.apply(e,u),o||(e=u=null)};return function(){var f=m.now();a||r.leading!==!1||(a=f);var l=t-(f-a);return e=this,u=arguments,0>=l||l>t?(o&&(clearTimeout(o),o=null),a=f,i=n.apply(e,u),o||(e=u=null)):o||r.trailing===!1||(o=setTimeout(c,l)),i}},m.debounce=function(n,t,r){var e,u,i,o,a,c=function(){var f=m.now()-o;t>f&&f>=0?e=setTimeout(c,t-f):(e=null,r||(a=n.apply(i,u),e||(i=u=null)))};return function(){i=this,u=arguments,o=m.now();var f=r&&!e;return e||(e=setTimeout(c,t)),f&&(a=n.apply(i,u),i=u=null),a}},m.wrap=function(n,t){return m.partial(t,n)},m.negate=function(n){return function(){return!n.apply(this,arguments)}},m.compose=function(){var n=arguments,t=n.length-1;return function(){for(var r=t,e=n[t].apply(this,arguments);r--;)e=n[r].call(this,e);return e}},m.after=function(n,t){return function(){return--n<1?t.apply(this,arguments):void 0}},m.before=function(n,t){var r;return function(){return--n>0&&(r=t.apply(this,arguments)),1>=n&&(t=null),r}},m.once=m.partial(m.before,2);var S=!{toString:null}.propertyIsEnumerable("toString"),F=["constructor","valueOf","isPrototypeOf","toString","propertyIsEnumerable","hasOwnProperty","toLocaleString"];m.keys=function(n){if(!m.isObject(n))return[];if(h)return h(n);var t=[];for(var e in n)m.has(n,e)&&t.push(e);return S&&r(n,t),t},m.allKeys=function(n){if(!m.isObject(n))return[];var t=[];for(var e in n)t.push(e);return S&&r(n,t),t},m.values=function(n){for(var t=m.keys(n),r=t.length,e=Array(r),u=0;r>u;u++)e[u]=n[t[u]];return e},m.mapObject=function(n,t,r){t=b(t,r);for(var e,u=m.keys(n),i=u.length,o={},a=0;i>a;a++)e=u[a],o[e]=t(n[e],e,n);return o},m.pairs=function(n){for(var t=m.keys(n),r=t.length,e=Array(r),u=0;r>u;u++)e[u]=[t[u],n[t[u]]];return e},m.invert=function(n){for(var t={},r=m.keys(n),e=0,u=r.length;u>e;e++)t[n[r[e]]]=r[e];return t},m.functions=m.methods=function(n){var t=[];for(var r in n)m.isFunction(n[r])&&t.push(r);return t.sort()},m.extend=x(m.allKeys),m.extendOwn=x(m.keys),m.findKey=function(n,t,r){t=b(t,r);for(var e,u=m.keys(n),i=0,o=u.length;o>i;i++)if(e=u[i],t(n[e],e,n))return e},m.pick=function(n,t,r){var e,u={};if(null==n)return u;if(m.isFunction(t)){t=d(t,r);for(e in n){var i=n[e];t(i,e,n)&&(u[e]=i)}}else{var o=k(arguments,!1,!1,1);n=new Object(n);for(var a=0,c=o.length;c>a;a++)e=o[a],e in n&&(u[e]=n[e])}return u},m.omit=function(n,t,r){if(m.isFunction(t))t=m.negate(t);else{var e=m.map(k(arguments,!1,!1,1),String);t=function(n,t){return!m.contains(e,t)}}return m.pick(n,t,r)},m.defaults=x(m.allKeys,!0),m.clone=function(n){return m.isObject(n)?m.isArray(n)?n.slice():m.extend({},n):n},m.tap=function(n,t){return t(n),n},m.isMatch=function(n,t){var r=m.keys(t),e=r.length;if(null==n)return!e;for(var u=Object(n),i=0;e>i;i++){var o=r[i];if(t[o]!==u[o]||!(o in u))return!1}return!0};var E=function(n,t,r,e){if(n===t)return 0!==n||1/n===1/t;if(null==n||null==t)return n===t;n instanceof m&&(n=n._wrapped),t instanceof m&&(t=t._wrapped);var u=l.call(n);if(u!==l.call(t))return!1;switch(u){case"[object RegExp]":case"[object String]":return""+n==""+t;case"[object Number]":return+n!==+n?+t!==+t:0===+n?1/+n===1/t:+n===+t;case"[object Date]":case"[object Boolean]":return+n===+t}var i="[object Array]"===u;if(!i){if("object"!=typeof n||"object"!=typeof t)return!1;var o=n.constructor,a=t.constructor;if(o!==a&&!(m.isFunction(o)&&o instanceof o&&m.isFunction(a)&&a instanceof a)&&"constructor"in n&&"constructor"in t)return!1}r=r||[],e=e||[];for(var c=r.length;c--;)if(r[c]===n)return e[c]===t;if(r.push(n),e.push(t),i){if(c=n.length,c!==t.length)return!1;for(;c--;)if(!E(n[c],t[c],r,e))return!1}else{var f,s=m.keys(n);if(c=s.length,m.keys(t).length!==c)return!1;for(;c--;)if(f=s[c],!m.has(t,f)||!E(n[f],t[f],r,e))return!1}return r.pop(),e.pop(),!0};m.isEqual=function(n,t){return E(n,t)},m.isEmpty=function(n){return null==n?!0:w(n)&&(m.isArray(n)||m.isString(n)||m.isArguments(n))?0===n.length:0===m.keys(n).length},m.isElement=function(n){return!(!n||1!==n.nodeType)},m.isArray=p||function(n){return"[object Array]"===l.call(n)},m.isObject=function(n){var t=typeof n;return"function"===t||"object"===t&&!!n},m.each(["Arguments","Function","String","Number","Date","RegExp","Error"],function(n){m["is"+n]=function(t){return l.call(t)==="[object "+n+"]"}}),m.isArguments(arguments)||(m.isArguments=function(n){return m.has(n,"callee")}),"function"!=typeof/./&&"object"!=typeof Int8Array&&(m.isFunction=function(n){return"function"==typeof n||!1}),m.isFinite=function(n){return isFinite(n)&&!isNaN(parseFloat(n))},m.isNaN=function(n){return m.isNumber(n)&&n!==+n},m.isBoolean=function(n){return n===!0||n===!1||"[object Boolean]"===l.call(n)},m.isNull=function(n){return null===n},m.isUndefined=function(n){return n===void 0},m.has=function(n,t){return null!=n&&s.call(n,t)},m.noConflict=function(){return e._=u,this},m.identity=function(n){return n},m.constant=function(n){return function(){return n}},m.noop=function(){},m.property=function(n){return function(t){return null==t?void 0:t[n]}},m.propertyOf=function(n){return null==n?function(){}:function(t){return n[t]}},m.matcher=m.matches=function(n){return n=m.extendOwn({},n),function(t){return m.isMatch(t,n)}},m.times=function(n,t,r){var e=Array(Math.max(0,n));t=d(t,r,1);for(var u=0;n>u;u++)e[u]=t(u);return e},m.random=function(n,t){return null==t&&(t=n,n=0),n+Math.floor(Math.random()*(t-n+1))},m.now=Date.now||function(){return(new Date).getTime()};var M={"&":"&","<":"<",">":">",'"':""","'":"'","`":"`"},N=m.invert(M),I=function(n){var t=function(t){return n[t]},r="(?:"+m.keys(n).join("|")+")",e=RegExp(r),u=RegExp(r,"g");return function(n){return n=null==n?"":""+n,e.test(n)?n.replace(u,t):n}};m.escape=I(M),m.unescape=I(N),m.result=function(n,t,r){var e=null==n?void 0:n[t];return e===void 0&&(e=r),m.isFunction(e)?e.call(n):e};var B=0;m.uniqueId=function(n){var t=++B+"";return n?n+t:t},m.templateSettings={evaluate:/<%([\s\S]+?)%>/g,interpolate:/<%=([\s\S]+?)%>/g,escape:/<%-([\s\S]+?)%>/g};var T=/(.)^/,R={"'":"'","\\":"\\","\r":"r","\n":"n","\u2028":"u2028","\u2029":"u2029"},q=/\\|'|\r|\n|\u2028|\u2029/g,z=function(n){return"\\"+R[n]};m.template=function(n,t,r){!t&&r&&(t=r),t=m.defaults({},t,m.templateSettings);var e=RegExp([(t.escape||T).source,(t.interpolate||T).source,(t.evaluate||T).source].join("|")+"|$","g"),u=0,i="__p+='";n.replace(e,function(t,r,e,o,a){return i+=n.slice(u,a).replace(q,z),u=a+t.length,r?i+="'+\n((__t=("+r+"))==null?'':_.escape(__t))+\n'":e?i+="'+\n((__t=("+e+"))==null?'':__t)+\n'":o&&(i+="';\n"+o+"\n__p+='"),t}),i+="';\n",t.variable||(i="with(obj||{}){\n"+i+"}\n"),i="var __t,__p='',__j=Array.prototype.join,"+"print=function(){__p+=__j.call(arguments,'');};\n"+i+"return __p;\n";try{var o=new Function(t.variable||"obj","_",i)}catch(a){throw a.source=i,a}var c=function(n){return o.call(this,n,m)},f=t.variable||"obj";return c.source="function("+f+"){\n"+i+"}",c},m.chain=function(n){var t=m(n);return t._chain=!0,t};var K=function(n,t){return n._chain?m(t).chain():t};m.mixin=function(n){m.each(m.functions(n),function(t){var r=m[t]=n[t];m.prototype[t]=function(){var n=[this._wrapped];return c.apply(n,arguments),K(this,r.apply(m,n))}})},m.mixin(m),m.each(["pop","push","reverse","shift","sort","splice","unshift"],function(n){var t=i[n];m.prototype[n]=function(){var r=this._wrapped;return t.apply(r,arguments),"shift"!==n&&"splice"!==n||0!==r.length||delete r[0],K(this,r)}}),m.each(["concat","join","slice"],function(n){var t=i[n];m.prototype[n]=function(){return K(this,t.apply(this._wrapped,arguments))}}),m.prototype.value=function(){return this._wrapped},m.prototype.valueOf=m.prototype.toJSON=m.prototype.value,m.prototype.toString=function(){return""+this._wrapped},"function"==typeof define&&define.amd&&define("underscore",[],function(){return m})}).call(this); | ||
(function(){function n(n){function r(r,t,e,u,i,o){for(;i>=0&&o>i;i+=n){var a=u?u[i]:i;e=t(e,r[a],a,r)}return e}return function(t,e,u,i){e=d(e,i,4);var o=!j(t)&&y.keys(t),a=(o||t).length,c=n>0?0:a-1;return arguments.length<3&&(u=t[o?o[c]:c],c+=n),r(t,e,u,o,c,a)}}function r(n){return function(r,t,e){t=m(t,e);for(var u=null!=r&&r.length,i=n>0?0:u-1;i>=0&&u>i;i+=n)if(t(r[i],i,r))return i;return-1}}var t=this,e=t._,u=Array.prototype,i=Object.prototype,o=Function.prototype,a=u.push,c=u.slice,l=i.toString,f=i.hasOwnProperty,s=Array.isArray,p=Object.keys,h=o.bind,v=Object.create,g=function(){},y=function(n){return n instanceof y?n:this instanceof y?void(this._wrapped=n):new y(n)};"undefined"!=typeof exports?("undefined"!=typeof module&&module.exports&&(exports=module.exports=y),exports._=y):t._=y,y.VERSION="1.8.1";var d=function(n,r,t){if(r===void 0)return n;switch(null==t?3:t){case 1:return function(t){return n.call(r,t)};case 2:return function(t,e){return n.call(r,t,e)};case 3:return function(t,e,u){return n.call(r,t,e,u)};case 4:return function(t,e,u,i){return n.call(r,t,e,u,i)}}return function(){return n.apply(r,arguments)}},m=function(n,r,t){return null==n?y.identity:y.isFunction(n)?d(n,r,t):y.isObject(n)?y.matcher(n):y.property(n)};y.iteratee=function(n,r){return m(n,r,1/0)};var b=function(n,r){return function(t){var e=arguments.length;if(2>e||null==t)return t;for(var u=1;e>u;u++)for(var i=arguments[u],o=n(i),a=o.length,c=0;a>c;c++){var l=o[c];r&&t[l]!==void 0||(t[l]=i[l])}return t}},x=function(n){if(!y.isObject(n))return{};if(v)return v(n);g.prototype=n;var r=new g;return g.prototype=null,r},_=Math.pow(2,53)-1,j=function(n){var r=n&&n.length;return"number"==typeof r&&r>=0&&_>=r};y.each=y.forEach=function(n,r,t){r=d(r,t);var e,u;if(j(n))for(e=0,u=n.length;u>e;e++)r(n[e],e,n);else{var i=y.keys(n);for(e=0,u=i.length;u>e;e++)r(n[i[e]],i[e],n)}return n},y.map=y.collect=function(n,r,t){r=m(r,t);for(var e=!j(n)&&y.keys(n),u=(e||n).length,i=Array(u),o=0;u>o;o++){var a=e?e[o]:o;i[o]=r(n[a],a,n)}return i},y.reduce=y.foldl=y.inject=n(1),y.reduceRight=y.foldr=n(-1),y.find=y.detect=function(n,r,t){var e;return e=j(n)?y.findIndex(n,r,t):y.findKey(n,r,t),e!==void 0&&e!==-1?n[e]:void 0},y.filter=y.select=function(n,r,t){var e=[];return r=m(r,t),y.each(n,function(n,t,u){r(n,t,u)&&e.push(n)}),e},y.reject=function(n,r,t){return y.filter(n,y.negate(m(r)),t)},y.every=y.all=function(n,r,t){r=m(r,t);for(var e=!j(n)&&y.keys(n),u=(e||n).length,i=0;u>i;i++){var o=e?e[i]:i;if(!r(n[o],o,n))return!1}return!0},y.some=y.any=function(n,r,t){r=m(r,t);for(var e=!j(n)&&y.keys(n),u=(e||n).length,i=0;u>i;i++){var o=e?e[i]:i;if(r(n[o],o,n))return!0}return!1},y.contains=y.includes=y.include=function(n,r){return j(n)||(n=y.values(n)),y.indexOf(n,r)>=0},y.invoke=function(n,r){var t=c.call(arguments,2),e=y.isFunction(r);return y.map(n,function(n){var u=e?r:n[r];return null==u?u:u.apply(n,t)})},y.pluck=function(n,r){return y.map(n,y.property(r))},y.where=function(n,r){return y.filter(n,y.matcher(r))},y.findWhere=function(n,r){return y.find(n,y.matcher(r))},y.max=function(n,r,t){var e,u,i=-1/0,o=-1/0;if(null==r&&null!=n){n=j(n)?n:y.values(n);for(var a=0,c=n.length;c>a;a++)e=n[a],e>i&&(i=e)}else r=m(r,t),y.each(n,function(n,t,e){u=r(n,t,e),(u>o||u===-1/0&&i===-1/0)&&(i=n,o=u)});return i},y.min=function(n,r,t){var e,u,i=1/0,o=1/0;if(null==r&&null!=n){n=j(n)?n:y.values(n);for(var a=0,c=n.length;c>a;a++)e=n[a],i>e&&(i=e)}else r=m(r,t),y.each(n,function(n,t,e){u=r(n,t,e),(o>u||1/0===u&&1/0===i)&&(i=n,o=u)});return i},y.shuffle=function(n){for(var r,t=j(n)?n:y.values(n),e=t.length,u=Array(e),i=0;e>i;i++)r=y.random(0,i),r!==i&&(u[i]=u[r]),u[r]=t[i];return u},y.sample=function(n,r,t){return null==r||t?(j(n)||(n=y.values(n)),n[y.random(n.length-1)]):y.shuffle(n).slice(0,Math.max(0,r))},y.sortBy=function(n,r,t){return r=m(r,t),y.pluck(y.map(n,function(n,t,e){return{value:n,index:t,criteria:r(n,t,e)}}).sort(function(n,r){var t=n.criteria,e=r.criteria;if(t!==e){if(t>e||t===void 0)return 1;if(e>t||e===void 0)return-1}return n.index-r.index}),"value")};var w=function(n){return function(r,t,e){var u={};return t=m(t,e),y.each(r,function(e,i){var o=t(e,i,r);n(u,e,o)}),u}};y.groupBy=w(function(n,r,t){y.has(n,t)?n[t].push(r):n[t]=[r]}),y.indexBy=w(function(n,r,t){n[t]=r}),y.countBy=w(function(n,r,t){y.has(n,t)?n[t]++:n[t]=1}),y.toArray=function(n){return n?y.isArray(n)?c.call(n):j(n)?y.map(n,y.identity):y.values(n):[]},y.size=function(n){return null==n?0:j(n)?n.length:y.keys(n).length},y.partition=function(n,r,t){r=m(r,t);var e=[],u=[];return y.each(n,function(n,t,i){(r(n,t,i)?e:u).push(n)}),[e,u]},y.first=y.head=y.take=function(n,r,t){return null==n?void 0:null==r||t?n[0]:y.initial(n,n.length-r)},y.initial=function(n,r,t){return c.call(n,0,Math.max(0,n.length-(null==r||t?1:r)))},y.last=function(n,r,t){return null==n?void 0:null==r||t?n[n.length-1]:y.rest(n,Math.max(0,n.length-r))},y.rest=y.tail=y.drop=function(n,r,t){return c.call(n,null==r||t?1:r)},y.compact=function(n){return y.filter(n,y.identity)};var A=function(n,r,t,e){for(var u=[],i=0,o=e||0,a=n&&n.length;a>o;o++){var c=n[o];if(j(c)&&(y.isArray(c)||y.isArguments(c))){r||(c=A(c,r,t));var l=0,f=c.length;for(u.length+=f;f>l;)u[i++]=c[l++]}else t||(u[i++]=c)}return u};y.flatten=function(n,r){return A(n,r,!1)},y.without=function(n){return y.difference(n,c.call(arguments,1))},y.uniq=y.unique=function(n,r,t,e){if(null==n)return[];y.isBoolean(r)||(e=t,t=r,r=!1),null!=t&&(t=m(t,e));for(var u=[],i=[],o=0,a=n.length;a>o;o++){var c=n[o],l=t?t(c,o,n):c;r?(o&&i===l||u.push(c),i=l):t?y.contains(i,l)||(i.push(l),u.push(c)):y.contains(u,c)||u.push(c)}return u},y.union=function(){return y.uniq(A(arguments,!0,!0))},y.intersection=function(n){if(null==n)return[];for(var r=[],t=arguments.length,e=0,u=n.length;u>e;e++){var i=n[e];if(!y.contains(r,i)){for(var o=1;t>o&&y.contains(arguments[o],i);o++);o===t&&r.push(i)}}return r},y.difference=function(n){var r=A(arguments,!0,!0,1);return y.filter(n,function(n){return!y.contains(r,n)})},y.zip=function(){return y.unzip(arguments)},y.unzip=function(n){for(var r=n&&y.max(n,"length").length||0,t=Array(r),e=0;r>e;e++)t[e]=y.pluck(n,e);return t},y.object=function(n,r){for(var t={},e=0,u=n&&n.length;u>e;e++)r?t[n[e]]=r[e]:t[n[e][0]]=n[e][1];return t},y.indexOf=function(n,r,t){var e=0,u=n&&n.length;if("number"==typeof t)e=0>t?Math.max(0,u+t):t;else if(t&&u)return e=y.sortedIndex(n,r),n[e]===r?e:-1;if(r!==r)return y.findIndex(c.call(n,e),y.isNaN);for(;u>e;e++)if(n[e]===r)return e;return-1},y.lastIndexOf=function(n,r,t){var e=n?n.length:0;if("number"==typeof t&&(e=0>t?e+t+1:Math.min(e,t+1)),r!==r)return y.findLastIndex(c.call(n,0,e),y.isNaN);for(;--e>=0;)if(n[e]===r)return e;return-1},y.findIndex=r(1),y.findLastIndex=r(-1),y.sortedIndex=function(n,r,t,e){t=m(t,e,1);for(var u=t(r),i=0,o=n.length;o>i;){var a=Math.floor((i+o)/2);t(n[a])<u?i=a+1:o=a}return i},y.range=function(n,r,t){arguments.length<=1&&(r=n||0,n=0),t=t||1;for(var e=Math.max(Math.ceil((r-n)/t),0),u=Array(e),i=0;e>i;i++,n+=t)u[i]=n;return u};var k=function(n,r,t,e,u){if(!(e instanceof r))return n.apply(t,u);var i=x(n.prototype),o=n.apply(i,u);return y.isObject(o)?o:i};y.bind=function(n,r){if(h&&n.bind===h)return h.apply(n,c.call(arguments,1));if(!y.isFunction(n))throw new TypeError("Bind must be called on a function");var t=c.call(arguments,2),e=function(){return k(n,e,r,this,t.concat(c.call(arguments)))};return e},y.partial=function(n){var r=c.call(arguments,1),t=function(){for(var e=0,u=r.length,i=Array(u),o=0;u>o;o++)i[o]=r[o]===y?arguments[e++]:r[o];for(;e<arguments.length;)i.push(arguments[e++]);return k(n,t,this,this,i)};return t},y.bindAll=function(n){var r,t,e=arguments.length;if(1>=e)throw new Error("bindAll must be passed function names");for(r=1;e>r;r++)t=arguments[r],n[t]=y.bind(n[t],n);return n},y.memoize=function(n,r){var t=function(e){var u=t.cache,i=""+(r?r.apply(this,arguments):e);return y.has(u,i)||(u[i]=n.apply(this,arguments)),u[i]};return t.cache={},t},y.delay=function(n,r){var t=c.call(arguments,2);return setTimeout(function(){return n.apply(null,t)},r)},y.defer=y.partial(y.delay,y,1),y.throttle=function(n,r,t){var e,u,i,o=null,a=0;t||(t={});var c=function(){a=t.leading===!1?0:y.now(),o=null,i=n.apply(e,u),o||(e=u=null)};return function(){var l=y.now();a||t.leading!==!1||(a=l);var f=r-(l-a);return e=this,u=arguments,0>=f||f>r?(o&&(clearTimeout(o),o=null),a=l,i=n.apply(e,u),o||(e=u=null)):o||t.trailing===!1||(o=setTimeout(c,f)),i}},y.debounce=function(n,r,t){var e,u,i,o,a,c=function(){var l=y.now()-o;r>l&&l>=0?e=setTimeout(c,r-l):(e=null,t||(a=n.apply(i,u),e||(i=u=null)))};return function(){i=this,u=arguments,o=y.now();var l=t&&!e;return e||(e=setTimeout(c,r)),l&&(a=n.apply(i,u),i=u=null),a}},y.wrap=function(n,r){return y.partial(r,n)},y.negate=function(n){return function(){return!n.apply(this,arguments)}},y.compose=function(){var n=arguments,r=n.length-1;return function(){for(var t=r,e=n[r].apply(this,arguments);t--;)e=n[t].call(this,e);return e}},y.after=function(n,r){return function(){return--n<1?r.apply(this,arguments):void 0}},y.before=function(n,r){var t;return function(){return--n>0&&(t=r.apply(this,arguments)),1>=n&&(r=null),t}},y.once=y.partial(y.before,2),y.keys=function(n){if(!y.isObject(n))return[];if(p)return p(n);var r=[];for(var t in n)y.has(n,t)&&r.push(t);return r},y.allKeys=function(n){if(!y.isObject(n))return[];var r=[];for(var t in n)r.push(t);return r},y.values=function(n){for(var r=y.keys(n),t=r.length,e=Array(t),u=0;t>u;u++)e[u]=n[r[u]];return e},y.mapObject=function(n,r,t){r=m(r,t);for(var e,u=y.keys(n),i=u.length,o={},a=0;i>a;a++)e=u[a],o[e]=r(n[e],e,n);return o},y.pairs=function(n){for(var r=y.keys(n),t=r.length,e=Array(t),u=0;t>u;u++)e[u]=[r[u],n[r[u]]];return e},y.invert=function(n){for(var r={},t=y.keys(n),e=0,u=t.length;u>e;e++)r[n[t[e]]]=t[e];return r},y.functions=y.methods=function(n){var r=[];for(var t in n)y.isFunction(n[t])&&r.push(t);return r.sort()},y.extend=b(y.allKeys),y.extendOwn=b(y.keys),y.findKey=function(n,r,t){r=m(r,t);for(var e,u=y.keys(n),i=0,o=u.length;o>i;i++)if(e=u[i],r(n[e],e,n))return e},y.pick=function(n,r,t){var e,u={};if(null==n)return u;if(y.isFunction(r)){r=d(r,t);for(var i=y.allKeys(n),o=0;o<i.length;o++){var e=i[o],a=n[e];r(a,e,n)&&(u[e]=a)}}else{var i=A(arguments,!1,!1,1);n=new Object(n);for(var o=0,c=i.length;c>o;o++)e=i[o],e in n&&(u[e]=n[e])}return u},y.omit=function(n,r,t){if(y.isFunction(r))r=y.negate(r);else{var e=y.map(A(arguments,!1,!1,1),String);r=function(n,r){return!y.contains(e,r)}}return y.pick(n,r,t)},y.defaults=b(y.allKeys,!0),y.clone=function(n){return y.isObject(n)?y.isArray(n)?n.slice():y.extend({},n):n},y.tap=function(n,r){return r(n),n},y.isMatch=function(n,r){var t=y.keys(r),e=t.length;if(null==n)return!e;for(var u=Object(n),i=0;e>i;i++){var o=t[i];if(r[o]!==u[o]||!(o in u))return!1}return!0};var O=function(n,r,t,e){if(n===r)return 0!==n||1/n===1/r;if(null==n||null==r)return n===r;n instanceof y&&(n=n._wrapped),r instanceof y&&(r=r._wrapped);var u=l.call(n);if(u!==l.call(r))return!1;switch(u){case"[object RegExp]":case"[object String]":return""+n==""+r;case"[object Number]":return+n!==+n?+r!==+r:0===+n?1/+n===1/r:+n===+r;case"[object Date]":case"[object Boolean]":return+n===+r}var i="[object Array]"===u;if(!i){if("object"!=typeof n||"object"!=typeof r)return!1;var o=n.constructor,a=r.constructor;if(o!==a&&!(y.isFunction(o)&&o instanceof o&&y.isFunction(a)&&a instanceof a)&&"constructor"in n&&"constructor"in r)return!1}t=t||[],e=e||[];for(var c=t.length;c--;)if(t[c]===n)return e[c]===r;if(t.push(n),e.push(r),i){if(c=n.length,c!==r.length)return!1;for(;c--;)if(!O(n[c],r[c],t,e))return!1}else{var f,s=y.keys(n);if(c=s.length,y.keys(r).length!==c)return!1;for(;c--;)if(f=s[c],!y.has(r,f)||!O(n[f],r[f],t,e))return!1}return t.pop(),e.pop(),!0};y.isEqual=function(n,r){return O(n,r)},y.isEmpty=function(n){return null==n?!0:j(n)&&(y.isArray(n)||y.isString(n)||y.isArguments(n))?0===n.length:0===y.keys(n).length},y.isElement=function(n){return!(!n||1!==n.nodeType)},y.isArray=s||function(n){return"[object Array]"===l.call(n)},y.isObject=function(n){var r=typeof n;return"function"===r||"object"===r&&!!n},y.each(["Arguments","Function","String","Number","Date","RegExp","Error"],function(n){y["is"+n]=function(r){return l.call(r)==="[object "+n+"]"}}),y.isArguments(arguments)||(y.isArguments=function(n){return y.has(n,"callee")}),"function"!=typeof/./&&"object"!=typeof Int8Array&&(y.isFunction=function(n){return"function"==typeof n||!1}),y.isFinite=function(n){return isFinite(n)&&!isNaN(parseFloat(n))},y.isNaN=function(n){return y.isNumber(n)&&n!==+n},y.isBoolean=function(n){return n===!0||n===!1||"[object Boolean]"===l.call(n)},y.isNull=function(n){return null===n},y.isUndefined=function(n){return n===void 0},y.has=function(n,r){return null!=n&&f.call(n,r)},y.noConflict=function(){return t._=e,this},y.identity=function(n){return n},y.constant=function(n){return function(){return n}},y.noop=function(){},y.property=function(n){return function(r){return null==r?void 0:r[n]}},y.propertyOf=function(n){return null==n?function(){}:function(r){return n[r]}},y.matcher=y.matches=function(n){return n=y.extendOwn({},n),function(r){return y.isMatch(r,n)}},y.times=function(n,r,t){var e=Array(Math.max(0,n));r=d(r,t,1);for(var u=0;n>u;u++)e[u]=r(u);return e},y.random=function(n,r){return null==r&&(r=n,n=0),n+Math.floor(Math.random()*(r-n+1))},y.now=Date.now||function(){return(new Date).getTime()};var F={"&":"&","<":"<",">":">",'"':""","'":"'","`":"`"},M=y.invert(F),N=function(n){var r=function(r){return n[r]},t="(?:"+y.keys(n).join("|")+")",e=RegExp(t),u=RegExp(t,"g");return function(n){return n=null==n?"":""+n,e.test(n)?n.replace(u,r):n}};y.escape=N(F),y.unescape=N(M),y.result=function(n,r,t){var e=null==n?void 0:n[r];return e===void 0&&(e=t),y.isFunction(e)?e.call(n):e};var E=0;y.uniqueId=function(n){var r=++E+"";return n?n+r:r},y.templateSettings={evaluate:/<%([\s\S]+?)%>/g,interpolate:/<%=([\s\S]+?)%>/g,escape:/<%-([\s\S]+?)%>/g};var S=/(.)^/,I={"'":"'","\\":"\\","\r":"r","\n":"n","\u2028":"u2028","\u2029":"u2029"},B=/\\|'|\r|\n|\u2028|\u2029/g,T=function(n){return"\\"+I[n]};y.template=function(n,r,t){!r&&t&&(r=t),r=y.defaults({},r,y.templateSettings);var e=RegExp([(r.escape||S).source,(r.interpolate||S).source,(r.evaluate||S).source].join("|")+"|$","g"),u=0,i="__p+='";n.replace(e,function(r,t,e,o,a){return i+=n.slice(u,a).replace(B,T),u=a+r.length,t?i+="'+\n((__t=("+t+"))==null?'':_.escape(__t))+\n'":e?i+="'+\n((__t=("+e+"))==null?'':__t)+\n'":o&&(i+="';\n"+o+"\n__p+='"),r}),i+="';\n",r.variable||(i="with(obj||{}){\n"+i+"}\n"),i="var __t,__p='',__j=Array.prototype.join,"+"print=function(){__p+=__j.call(arguments,'');};\n"+i+"return __p;\n";try{var o=new Function(r.variable||"obj","_",i)}catch(a){throw a.source=i,a}var c=function(n){return o.call(this,n,y)},l=r.variable||"obj";return c.source="function("+l+"){\n"+i+"}",c},y.chain=function(n){var r=y(n);return r._chain=!0,r};var R=function(n,r){return n._chain?y(r).chain():r};y.mixin=function(n){y.each(y.functions(n),function(r){var t=y[r]=n[r];y.prototype[r]=function(){var n=[this._wrapped];return a.apply(n,arguments),R(this,t.apply(y,n))}})},y.mixin(y),y.each(["pop","push","reverse","shift","sort","splice","unshift"],function(n){var r=u[n];y.prototype[n]=function(){var t=this._wrapped;return r.apply(t,arguments),"shift"!==n&&"splice"!==n||0!==t.length||delete t[0],R(this,t)}}),y.each(["concat","join","slice"],function(n){var r=u[n];y.prototype[n]=function(){return R(this,r.apply(this._wrapped,arguments))}}),y.prototype.value=function(){return this._wrapped},y.prototype.valueOf=y.prototype.toJSON=y.prototype.value,y.prototype.toString=function(){return""+this._wrapped},"function"==typeof define&&define.amd&&define("underscore",[],function(){return y})}).call(this); | ||
//# sourceMappingURL=underscore-min.map |
@@ -1,2 +0,2 @@ | ||
// Underscore.js 1.8.0 | ||
// Underscore.js 1.8.1 | ||
// http://underscorejs.org | ||
@@ -35,3 +35,3 @@ // (c) 2009-2015 Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors | ||
// Reusable constructor function for prototype setting. | ||
// Naked function reference for surrogate-prototype-swapping. | ||
var Ctor = function(){}; | ||
@@ -59,3 +59,3 @@ | ||
// Current version. | ||
_.VERSION = '1.8.0'; | ||
_.VERSION = '1.8.1'; | ||
@@ -710,5 +710,6 @@ // Internal function that returns an efficient (for current engines) version | ||
var args = slice.call(arguments, 2); | ||
return function bound() { | ||
var bound = function() { | ||
return executeBound(func, bound, context, this, args.concat(slice.call(arguments))); | ||
}; | ||
return bound; | ||
}; | ||
@@ -721,3 +722,3 @@ | ||
var boundArgs = slice.call(arguments, 1); | ||
return function bound() { | ||
var bound = function() { | ||
var position = 0, length = boundArgs.length; | ||
@@ -731,2 +732,3 @@ var args = Array(length); | ||
}; | ||
return bound; | ||
}; | ||
@@ -900,20 +902,2 @@ | ||
// Keys in IE < 9 that won't be iterated by `for key in ...` and thus missed. | ||
var hasEnumBug = !{toString: null}.propertyIsEnumerable('toString'); | ||
var nonEnumerableProps = ['constructor', 'valueOf', 'isPrototypeOf', 'toString', | ||
'propertyIsEnumerable', 'hasOwnProperty', 'toLocaleString']; | ||
function collectNonEnumProps(obj, keys) { | ||
var nonEnumIdx = nonEnumerableProps.length; | ||
var proto = typeof obj.constructor === 'function' ? FuncProto : ObjProto; | ||
while (nonEnumIdx--) { | ||
var prop = nonEnumerableProps[nonEnumIdx]; | ||
if (prop === 'constructor' ? _.has(obj, prop) : prop in obj && | ||
obj[prop] !== proto[prop] && !_.contains(keys, prop)) { | ||
keys.push(prop); | ||
} | ||
} | ||
} | ||
// Retrieve the names of an object's own properties. | ||
@@ -926,4 +910,2 @@ // Delegates to **ECMAScript 5**'s native `Object.keys` | ||
for (var key in obj) if (_.has(obj, key)) keys.push(key); | ||
// Ahem, IE < 9. | ||
if (hasEnumBug) collectNonEnumProps(obj, keys); | ||
return keys; | ||
@@ -937,4 +919,2 @@ }; | ||
for (var key in obj) keys.push(key); | ||
// Ahem, IE < 9. | ||
if (hasEnumBug) collectNonEnumProps(obj, keys); | ||
return keys; | ||
@@ -1023,3 +1003,5 @@ }; | ||
iteratee = optimizeCb(iteratee, context); | ||
for (key in obj) { | ||
var keys = _.allKeys(obj); | ||
for (var i = 0; i < keys.length; i++) { | ||
var key = keys[i]; | ||
var value = obj[key]; | ||
@@ -1026,0 +1008,0 @@ if (iteratee(value, key, obj)) result[key] = value; |
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
97885
1406