Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

mdn-polyfills

Package Overview
Dependencies
Maintainers
1
Versions
42
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

mdn-polyfills - npm Package Compare versions

Comparing version 5.5.0 to 5.6.0

2

Array.from.js

@@ -1,1 +0,1 @@

Array.from||(Array.from=function(){var r=Object.prototype.toString,n=function(n){return"function"==typeof n||"[object Function]"===r.call(n)},t=function(r){var n=Number(r);return isNaN(n)?0:0!==n&&isFinite(n)?(n>0?1:-1)*Math.floor(Math.abs(n)):n},e=Math.pow(2,53)-1,o=function(r){var n=t(r);return Math.min(Math.max(n,0),e)};return function(r){var t=this,e=Object(r);if(null==r)throw new TypeError("Array.from requires an array-like object - not null or undefined");var a,i=arguments.length>1?arguments[1]:void 0;if(void 0!==i){if(!n(i))throw new TypeError("Array.from: when provided, the second argument must be a function");arguments.length>2&&(a=arguments[2])}for(var u,f=o(e.length),c=n(t)?Object(new t(f)):new Array(f),h=0;h<f;)u=e[h],c[h]=i?void 0===a?i(u,h):i.call(a,u,h):u,h+=1;return c.length=f,c}}());
!function(){var r,n,t,e;Array.from||(Array.from=(r=Object.prototype.toString,n=function(n){return"function"==typeof n||"[object Function]"===r.call(n)},t=Math.pow(2,53)-1,e=function(r){var n=function(r){var n=Number(r);return isNaN(n)?0:0!==n&&isFinite(n)?(n>0?1:-1)*Math.floor(Math.abs(n)):n}(r);return Math.min(Math.max(n,0),t)},function(r){var t=Object(r);if(null==r)throw new TypeError("Array.from requires an array-like object - not null or undefined");var o,a=arguments.length>1?arguments[1]:void 0;if(void 0!==a){if(!n(a))throw new TypeError("Array.from: when provided, the second argument must be a function");arguments.length>2&&(o=arguments[2])}for(var i,u=e(t.length),f=n(this)?Object(new this(u)):new Array(u),c=0;c<u;)i=t[c],f[c]=a?void 0===o?a(i,c):a.call(o,i,c):i,c+=1;return f.length=u,f}))}();

@@ -1,1 +0,1 @@

Array.of||(Array.of=function(){return Array.prototype.slice.call(arguments)});
!function(){Array.of||(Array.of=function(){return Array.prototype.slice.call(arguments)})}();

@@ -1,1 +0,1 @@

Array.prototype.filter||(Array.prototype.filter=function(r){if(void 0===this||null===this)throw new TypeError;var t=Object(this),o=t.length>>>0;if("function"!=typeof r)throw new TypeError;for(var e=[],i=arguments.length>=2?arguments[1]:void 0,n=0;n<o;n++)if(n in t){var f=t[n];r.call(i,f,n,t)&&e.push(f)}return e});
!function(){Array.prototype.filter||(Array.prototype.filter=function(r){if(void 0===this||null===this)throw new TypeError;var t=Object(this),o=t.length>>>0;if("function"!=typeof r)throw new TypeError;for(var i=[],e=arguments.length>=2?arguments[1]:void 0,n=0;n<o;n++)if(n in t){var f=t[n];r.call(e,f,n,t)&&i.push(f)}return i})}();

@@ -1,1 +0,1 @@

Array.prototype.findIndex||Object.defineProperty(Array.prototype,"findIndex",{value:function(r){if(null==this)throw new TypeError('"this" is null or not defined');var e=Object(this),t=e.length>>>0;if("function"!=typeof r)throw new TypeError("predicate must be a function");for(var n=arguments[1],o=0;o<t;){var i=e[o];if(r.call(n,i,o,e))return o;o++}return-1}});
!function(){Array.prototype.findIndex||Object.defineProperty(Array.prototype,"findIndex",{value:function(r){if(null==this)throw new TypeError('"this" is null or not defined');var e=Object(this),t=e.length>>>0;if("function"!=typeof r)throw new TypeError("predicate must be a function");for(var n=arguments[1],o=0;o<t;){var i=e[o];if(r.call(n,i,o,e))return o;o++}return-1}})}();

@@ -1,1 +0,1 @@

Array.prototype.forEach||(Array.prototype.forEach=function(r,o){var t,n;if(null===this)throw new TypeError(" this is null or not defined");var e=Object(this),i=e.length>>>0;if("function"!=typeof r)throw new TypeError(r+" is not a function");for(arguments.length>1&&(t=o),n=0;n<i;){var f;n in e&&(f=e[n],r.call(t,f,n,e)),n++}});
!function(){Array.prototype.forEach||(Array.prototype.forEach=function(r,o){var t,n;if(null===this)throw new TypeError(" this is null or not defined");var i=Object(this),e=i.length>>>0;if("function"!=typeof r)throw new TypeError(r+" is not a function");for(arguments.length>1&&(t=o),n=0;n<e;){var f;n in i&&(f=i[n],r.call(t,f,n,i)),n++}})}();

@@ -1,1 +0,1 @@

Array.prototype.includes||(Array.prototype.includes=function(r){if(null==this)throw new TypeError("Array.prototype.includes called on null or undefined");var e=Object(this),n=parseInt(e.length,10)||0;if(0===n)return!1;var t,o=parseInt(arguments[1],10)||0;o>=0?t=o:(t=n+o)<0&&(t=0);for(var i;t<n;){if(i=e[t],r===i||r!==r&&i!==i)return!0;t++}return!1});
!function(){Array.prototype.includes||(Array.prototype.includes=function(r){if(null==this)throw new TypeError("Array.prototype.includes called on null or undefined");var n=Object(this),e=parseInt(n.length,10)||0;if(0===e)return!1;var t,o,i=parseInt(arguments[1],10)||0;for(i>=0?t=i:(t=e+i)<0&&(t=0);t<e;){if(r===(o=n[t])||r!=r&&o!=o)return!0;t++}return!1})}();

@@ -1,1 +0,1 @@

!function(){function t(t,e){e=e||{bubbles:!1,cancelable:!1,detail:void 0};var n=document.createEvent("CustomEvent");return n.initCustomEvent(t,e.bubbles,e.cancelable,e.detail),n}if("function"==typeof window.CustomEvent)return!1;t.prototype=window.Event.prototype,window.CustomEvent=t}();
!function(){!function(){if("function"==typeof window.CustomEvent)return!1;function t(t,n){n=n||{bubbles:!1,cancelable:!1,detail:void 0};var e=document.createEvent("CustomEvent");return e.initCustomEvent(t,n.bubbles,n.cancelable,n.detail),e}t.prototype=window.Event.prototype,window.CustomEvent=t}()}();

@@ -1,1 +0,1 @@

window.Element&&!Element.prototype.closest&&(Element.prototype.closest=function(e){var t,o=(this.document||this.ownerDocument).querySelectorAll(e),n=this;do{for(t=o.length;--t>=0&&o.item(t)!==n;);}while(t<0&&(n=n.parentElement));return n});
!function(){window.Element&&!Element.prototype.closest&&(Element.prototype.closest=function(e){var t,n=(this.document||this.ownerDocument).querySelectorAll(e),o=this;do{for(t=n.length;--t>=0&&n.item(t)!==o;);}while(t<0&&(o=o.parentElement));return o})}();

@@ -1,1 +0,1 @@

Function.prototype.bind||(Function.prototype.bind=function(t){if("function"!=typeof this)throw new TypeError("Function.prototype.bind - what is trying to be bound is not callable");var o=Array.prototype.slice.call(arguments,1),n=this,i=function(){},r=function(){return n.apply(this instanceof i?this:t,o.concat(Array.prototype.slice.call(arguments)))};return this.prototype&&(i.prototype=this.prototype),r.prototype=new i,r});
!function(){Function.prototype.bind||(Function.prototype.bind=function(t){if("function"!=typeof this)throw new TypeError("Function.prototype.bind - what is trying to be bound is not callable");var o=Array.prototype.slice.call(arguments,1),n=this,i=function(){},r=function(){return n.apply(this instanceof i?this:t,o.concat(Array.prototype.slice.call(arguments)))};return this.prototype&&(i.prototype=this.prototype),r.prototype=new i,r})}();

@@ -1,1 +0,1 @@

!function(){try{return new e("test"),!1}catch(e){}var e=function(e,t){t=t||{bubbles:!1,cancelable:!1};var n=document.createEvent("MouseEvent");return n.initMouseEvent(e,t.bubbles,t.cancelable,window,0,0,0,0,0,!1,!1,!1,!1,0,null),n};e.prototype=Event.prototype,window.MouseEvent=e}();
!function(){!function(){try{return new e("test"),!1}catch(e){}var e=function(e,n){n=n||{bubbles:!1,cancelable:!1};var t=document.createEvent("MouseEvent");return t.initMouseEvent(e,n.bubbles,n.cancelable,window,0,0,0,0,0,!1,!1,!1,!1,0,null),t};e.prototype=Event.prototype,window.MouseEvent=e}()}();

@@ -1,1 +0,1 @@

window.NodeList&&!NodeList.prototype.forEach&&(NodeList.prototype.forEach=function(o,t){t=t||window;for(var i=0;i<this.length;i++)o.call(t,this[i],i,this)});
!function(){window.NodeList&&!NodeList.prototype.forEach&&(NodeList.prototype.forEach=function(o,t){t=t||window;for(var i=0;i<this.length;i++)o.call(t,this[i],i,this)})}();

@@ -1,1 +0,1 @@

"function"!=typeof Object.create&&(Object.create=function(t){var e=function(){};return function(r,n){if(r!==Object(r))throw TypeError("Argument must be an object, or null");e.prototype=r||{};var o=new e;return e.prototype=null,n!==t&&Object.defineProperties(o,n),null===r&&(o.__proto__=null),o}}());
!function(){"function"!=typeof Object.create&&(Object.create=function(t){var e=function(){};return function(n,r){if(n!==Object(n))throw TypeError("Argument must be an object, or null");e.prototype=n||{};var o=new e;return e.prototype=null,r!==t&&Object.defineProperties(o,r),null===n&&(o.__proto__=null),o}}())}();
{
"name": "mdn-polyfills",
"version": "5.5.0",
"version": "5.6.0",
"description": "MDN polyfills",

@@ -63,3 +63,3 @@ "scripts": {

"devDependencies": {
"ava": "^0.23.0",
"ava": "^0.25.0",
"babel-cli": "^6.26.0",

@@ -69,7 +69,6 @@ "babel-plugin-external-helpers": "^6.22.0",

"babelrc-rollup": "^3.0.0",
"eslint-config-helmut": "^2.2.0",
"eslint-plugin-react": "^7.4.0",
"rollup": "^0.51.2",
"rollup-plugin-babel": "^3.0.2",
"rollup-plugin-uglify": "^2.0.1",
"eslint-config-helmut": "^3.0.0",
"rollup": "^0.58.2",
"rollup-plugin-babel": "^3.0.4",
"rollup-plugin-uglify": "^3.0.0",
"tap-nyan": "^1.1.0"

@@ -76,0 +75,0 @@ },

[https://msn0.github.io/mdn-polyfills](https://msn0.github.io/mdn-polyfills)
# Polyfills copy-pasted from MDN [![Build Status](https://travis-ci.org/msn0/mdn-polyfills.svg?branch=master)](http://travis-ci.org/msn0/mdn-polyfills) [![npm](https://img.shields.io/npm/dt/mdn-polyfills.svg)](https://www.npmjs.com/package/mdn-polyfills)
# Polyfills copy-pasted from MDN [![Build Status](https://travis-ci.org/msn0/mdn-polyfills.svg?branch=master)](http://travis-ci.org/msn0/mdn-polyfills) [![npm](https://img.shields.io/npm/dt/mdn-polyfills.svg)](https://www.npmjs.com/package/mdn-polyfills) ![dependencies](https://david-dm.org/msn0/mdn-polyfills.svg)

@@ -24,3 +24,3 @@ > [MDN](https://developer.mozilla.org) polyfills. A collection of side-effect ECMAScript modules. Minimized, mangled and extremely small thanks to [Rollup](https://rollupjs.org) - next-generation ES6 module bundler.

```js
import 'mdn-polyfills/Object.create'; // 300 bytes
import 'mdn-polyfills/Object.create'; // 315 bytes
```

@@ -37,3 +37,3 @@

```js
import 'mdn-polyfills/Array.from'; // 812 bytes
import 'mdn-polyfills/Array.from'; // 811 bytes
```

@@ -44,3 +44,3 @@

```js
import 'mdn-polyfills/Array.of'; // 79 bytes
import 'mdn-polyfills/Array.of'; // 94 bytes
```

@@ -58,3 +58,3 @@

```js
import 'mdn-polyfills/Array.prototype.forEach'; // 328 bytes
import 'mdn-polyfills/Array.prototype.forEach'; // 343 bytes
```

@@ -65,3 +65,3 @@

```js
import 'mdn-polyfills/Array.prototype.filter'; // 316 bytes
import 'mdn-polyfills/Array.prototype.filter'; // 331 bytes
```

@@ -72,3 +72,3 @@

```js
import 'mdn-polyfills/Array.prototype.findIndex'; // 362 bytes
import 'mdn-polyfills/Array.prototype.findIndex'; // 377 bytes
```

@@ -79,3 +79,3 @@

```js
import 'mdn-polyfills/Array.prototype.includes'; // 352 bytes
import 'mdn-polyfills/Array.prototype.includes'; // 361 bytes
```

@@ -86,3 +86,3 @@

```js
import 'mdn-polyfills/String.prototype.includes'; // 166 bytes
import 'mdn-polyfills/String.prototype.includes'; // 153 bytes
```

@@ -93,3 +93,3 @@

```js
import 'mdn-polyfills/String.prototype.repeat'; // 504 bytes
import 'mdn-polyfills/String.prototype.repeat'; // 519 bytes
```

@@ -100,3 +100,3 @@

```js
import 'mdn-polyfills/String.prototype.startsWith'; // 117 bytes
import 'mdn-polyfills/String.prototype.startsWith'; // 132 bytes
```

@@ -107,3 +107,3 @@

```js
import 'mdn-polyfills/String.prototype.endsWith'; // 148 bytes
import 'mdn-polyfills/String.prototype.endsWith'; // 163 bytes
```

@@ -126,3 +126,3 @@

```js
import 'mdn-polyfills/Function.prototype.bind'; // 427 bytes
import 'mdn-polyfills/Function.prototype.bind'; // 442 bytes
```

@@ -139,3 +139,3 @@

```js
import 'mdn-polyfills/NodeList.prototype.forEach'; // 158 bytes
import 'mdn-polyfills/NodeList.prototype.forEach'; // 173 bytes
```

@@ -146,3 +146,3 @@

```js
import 'mdn-polyfills/Element.prototype.closest'; // 241 bytes
import 'mdn-polyfills/Element.prototype.closest'; // 256 bytes
```

@@ -159,3 +159,3 @@

```js
import 'mdn-polyfills/MouseEvent'; // 284 bytes
import 'mdn-polyfills/MouseEvent'; // 299 bytes
```

@@ -166,3 +166,3 @@

```js
import 'mdn-polyfills/CustomEvent'; // 288 bytes
import 'mdn-polyfills/CustomEvent'; // 303 bytes
```

@@ -172,2 +172,3 @@

MIT © [Michał Jezierski](https://github.com/msn0)
The mdn-polyfills as a module is licensed under MIT © [Michał Jezierski](https://github.com/msn0)<br/>
Polyfills are licensed under https://developer.mozilla.org/en-US/docs/MDN/About#Copyrights_and_licenses

@@ -1,1 +0,1 @@

String.prototype.endsWith||(String.prototype.endsWith=function(t,n){return n<this.length?n|=0:n=this.length,this.substr(n-t.length,t.length)===t});
!function(){String.prototype.endsWith||(String.prototype.endsWith=function(t,n){return n<this.length?n|=0:n=this.length,this.substr(n-t.length,t.length)===t})}();

@@ -1,1 +0,1 @@

String.prototype.repeat||(String.prototype.repeat=function(t){if(null==this)throw new TypeError("can't convert "+this+" to object");var r=""+this;if((t=+t)!=t&&(t=0),t<0)throw new RangeError("repeat count must be non-negative");if(t==1/0)throw new RangeError("repeat count must be less than infinity");if(t=Math.floor(t),0==r.length||0==t)return"";if(r.length*t>=1<<28)throw new RangeError("repeat count must not overflow maximum string size");for(var e="";1==(1&t)&&(e+=r),0!=(t>>>=1);)r+=r;return e});
!function(){String.prototype.repeat||(String.prototype.repeat=function(t){if(null==this)throw new TypeError("can't convert "+this+" to object");var r=""+this;if((t=+t)!=t&&(t=0),t<0)throw new RangeError("repeat count must be non-negative");if(t==1/0)throw new RangeError("repeat count must be less than infinity");if(t=Math.floor(t),0==r.length||0==t)return"";if(r.length*t>=1<<28)throw new RangeError("repeat count must not overflow maximum string size");for(var e="";1==(1&t)&&(e+=r),0!=(t>>>=1);)r+=r;return e})}();

@@ -1,1 +0,1 @@

String.prototype.startsWith||(String.prototype.startsWith=function(t,r){return r=r||0,this.substr(r,t.length)===t});
!function(){String.prototype.startsWith||(String.prototype.startsWith=function(t,r){return r=r||0,this.substr(r,t.length)===t})}();
SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc