1
0
mirror of https://codeberg.org/nobody/LocalCDN.git synced 2025-01-11 01:25:32 +01:00
LocalCDN-Firefox-Chrome-Brave/resources/underscore.js/1.8.1/underscore-min.jsm

6 lines
16 KiB
JavaScript
Raw Normal View History

2020-02-27 13:45:29 +01:00
// 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 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