-
Notifications
You must be signed in to change notification settings - Fork 14
/
shim.min.js
1 lines (1 loc) · 2.16 KB
/
shim.min.js
1
Object.keys||(Object.keys=function(){var r=Object.prototype.hasOwnProperty,t=!{toString:null}.propertyIsEnumerable("toString"),e=["toString","toLocaleString","valueOf","hasOwnProperty","isPrototypeOf","propertyIsEnumerable","constructor"],n=e.length;return function(o){if("object"!=typeof o&&"function"!=typeof o||null===o)throw new TypeError("Object.keys called on non-object");var i=[];for(var a in o)r.call(o,a)&&i.push(a);if(t)for(var f=0;n>f;f++)r.call(o,e[f])&&i.push(e[f]);return i}}()),Array.prototype.filter||(Array.prototype.filter=function(r){"use strict";if(null==this)throw new TypeError;var t=Object(this),e=t.length>>>0;if("function"!=typeof r)throw new TypeError;for(var n=[],o=arguments[1],i=0;e>i;i++)if(i in t){var a=t[i];r.call(o,a,i,t)&&n.push(a)}return n}),String.prototype.trim||(String.prototype.trim=function(){return this.replace(/^\s+|\s+$/g,"")}),Array.prototype.forEach||(Array.prototype.forEach=function(r){"use strict";if(void 0===this||null===this)throw new TypeError;var t=Object(this),e=t.length>>>0;if("function"!=typeof r)throw new TypeError;for(var n=arguments.length>=2?arguments[1]:void 0,o=0;e>o;o++)o in t&&r.call(n,t[o],o,t)}),Array.prototype.map||(Array.prototype.map=function(r,t){var e,n,o;if(null==this)throw new TypeError(" this is null or not defined");var i=Object(this),a=i.length>>>0;if("function"!=typeof r)throw new TypeError(r+" is not a function");for(t&&(e=t),n=new Array(a),o=0;a>o;){var f,y;o in i&&(f=i[o],y=r.call(e,f,o,i),n[o]=y),o++}return n}),Array.prototype.indexOf||(Array.prototype.indexOf=function(r,t){if(void 0===this||null===this)throw new TypeError('"this" is null or not defined');var e=this.length>>>0;for(t=+t||0,Math.abs(t)===1/0&&(t=0),0>t&&(t+=e,0>t&&(t=0));e>t;t++)if(this[t]===r)return t;return-1}),Array.isArray||(Array.isArray=function(r){return"[object Array]"===Object.prototype.toString.call(r)}),"undefined"==typeof ArrayBuffer||ArrayBuffer.prototype.slice||(ArrayBuffer.prototype.slice=function(r,t){r=0|r||0;var e=this.byteLength;if(t=void 0===t?e:0|t,0>r&&(r+=e),0>t&&(t+=e),0===e||r>=e||r>=t)return new ArrayBuffer(0);var n=Math.min(e-r,t-r),o=new ArrayBuffer(n),i=new Uint8Array(o);return i.set(new Uint8Array(this,r,n)),o});