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.3.0 to 5.4.0

Object.entries.js

2

Array.from.js

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

!function(){"use strict";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 i,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&&(i=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]=a?void 0===i?a(u,h):a.call(i,u,h):u,h+=1;return c.length=f,c}}())}();
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}}());

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

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

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

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

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

!function(){"use strict";Array.prototype.find||(Array.prototype.find=function(r){if(null==this)throw new TypeError("Array.prototype.find called on null or undefined");if("function"!=typeof r)throw new TypeError("predicate must be a function");for(var t=Object(this),n=t.length>>>0,o=arguments[1],e=void 0,i=0;i<n;i++)if(e=t[i],r.call(o,e,i,t))return e})}();
!function(){Array.prototype.find||(Array.prototype.find=function(r){if(null==this)throw new TypeError("Array.prototype.find called on null or undefined");if("function"!=typeof r)throw new TypeError("predicate must be a function");for(var n=Object(this),t=n.length>>>0,o=arguments[1],e=void 0,i=0;i<t;i++)if(e=n[i],r.call(o,e,i,n))return e})}();

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

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

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

!function(){"use strict";Array.prototype.forEach||(Array.prototype.forEach=function(r,t){var o,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&&(o=t),n=0;n<e;){var f;n in i&&(f=i[n],r.call(o,f,n,i)),n++}})}();
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++}});

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

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

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

!function(){"use strict";!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 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}();

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

!function(){"use strict";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})}();
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});

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

!function(){"use strict";Element.prototype.matches||(Element.prototype.matches=Element.prototype.msMatchesSelector||Element.prototype.webkitMatchesSelector)}();
Element.prototype.matches||(Element.prototype.matches=Element.prototype.msMatchesSelector||Element.prototype.webkitMatchesSelector);

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

!function(){"use strict";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.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(){"use strict";!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(){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}();

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

!function(){"use strict";window.NodeList&&!NodeList.prototype.forEach&&(NodeList.prototype.forEach=function(t,o){o=o||window;for(var i=0;i<this.length;i++)t.call(o,this[i],i,this)})}();
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(){"use strict";"function"!=typeof Object.assign&&(Object.assign=function(n){if(void 0===n||null===n)throw new TypeError("Cannot convert undefined or null to object");for(var t=Object(n),o=1;o<arguments.length;o++){var r=arguments[o];if(void 0!==r&&null!==r)for(var e in r)r.hasOwnProperty(e)&&(t[e]=r[e])}return t})}();
!function(){"function"!=typeof Object.assign&&(Object.assign=function(n){if(void 0===n||null===n)throw new TypeError("Cannot convert undefined or null to object");for(var o=Object(n),r=1;r<arguments.length;r++){var t=arguments[r];if(void 0!==t&&null!==t)for(var e in t)t.hasOwnProperty(e)&&(o[e]=t[e])}return o})}();

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

!function(){"use strict";"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}}())}();
"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}}());
{
"name": "mdn-polyfills",
"version": "5.3.0",
"version": "5.4.0",
"description": "MDN polyfills",

@@ -5,0 +5,0 @@ "scripts": {

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

https://msn0.github.io/mdn-polyfills
[https://msn0.github.io/mdn-polyfills](https://msn0.github.io/mdn-polyfills)

@@ -18,3 +18,3 @@ # 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)

```js
import 'mdn-polyfills/Object.assign'; // 330 bytes
import 'mdn-polyfills/Object.assign'; // 317 bytes
```

@@ -25,9 +25,15 @@

```js
import 'mdn-polyfills/Object.create'; // 328 bytes
import 'mdn-polyfills/Object.create'; // 300 bytes
```
### [Object.entries](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object/entries)
```js
import 'mdn-polyfills/Object.entries'; // 166 bytes
```
### [Array.from](https://developer.mozilla.org/en/docs/Web/JavaScript/Reference/Global_Objects/Array/from?v=control#Polyfill)
```js
import 'mdn-polyfills/Array.from'; // 840 bytes
import 'mdn-polyfills/Array.from'; // 812 bytes
```

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

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

@@ -45,3 +51,3 @@

```js
import 'mdn-polyfills/Array.prototype.find'; // 358 bytes
import 'mdn-polyfills/Array.prototype.find'; // 345 bytes
```

@@ -53,3 +59,3 @@

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

@@ -60,3 +66,3 @@

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

@@ -67,3 +73,3 @@

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

@@ -74,3 +80,3 @@

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

@@ -81,3 +87,3 @@

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

@@ -88,3 +94,3 @@

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

@@ -95,3 +101,3 @@

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

@@ -102,3 +108,3 @@

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

@@ -109,3 +115,3 @@

```js
import 'mdn-polyfills/String.prototype.padStart'; // 237 bytes
import 'mdn-polyfills/String.prototype.padStart'; // 224 bytes
```

@@ -116,3 +122,3 @@

```js
import 'mdn-polyfills/String.prototype.padEnd'; // 233 bytes
import 'mdn-polyfills/String.prototype.padEnd'; // 220 bytes
```

@@ -123,3 +129,3 @@

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

@@ -130,3 +136,3 @@

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

@@ -137,3 +143,3 @@

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

@@ -144,3 +150,3 @@

```js
import 'mdn-polyfills/Element.prototype.matches'; // 161 bytes
import 'mdn-polyfills/Element.prototype.matches'; // 133 bytes
```

@@ -151,3 +157,3 @@

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

@@ -158,3 +164,3 @@

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

@@ -161,0 +167,0 @@

@@ -8,3 +8,4 @@ const babelrc = require('babelrc-rollup').default;

format: 'iife',
name: 'Polyfill'
name: 'Polyfill',
strict: false
};

@@ -26,2 +27,3 @@

rollup(input('./src/Object.assign/index.js')).then(output('./Object.assign.js'));
rollup(input('./src/Object.entries/index.js')).then(output('./Object.entries.js'));
rollup(input('./src/Object.create/index.js')).then(output('./Object.create.js'));

@@ -28,0 +30,0 @@ rollup(input('./src/Array.prototype.find/index.js')).then(output('./Array.prototype.find.js'));

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

!function(){"use strict";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})}();
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 @@

!function(){"use strict";String.prototype.includes||(String.prototype.includes=function(t,n){return"number"!=typeof n&&(n=0),!(n+t.length>this.length)&&-1!==this.indexOf(t,n)})}();
String.prototype.includes||(String.prototype.includes=function(t,e){"use strict";return"number"!=typeof e&&(e=0),!(e+t.length>this.length)&&-1!==this.indexOf(t,e)});

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

!function(){"use strict";String.prototype.padEnd||(String.prototype.padEnd=function(t,n){return t>>=0,n=String(n||" "),this.length>t?String(this):((t-=this.length)>n.length&&(n+=n.repeat(t/n.length)),String(this)+n.slice(0,t))})}();
!function(){String.prototype.padEnd||(String.prototype.padEnd=function(t,n){return t>>=0,n=String(n||" "),this.length>t?String(this):((t-=this.length)>n.length&&(n+=n.repeat(t/n.length)),String(this)+n.slice(0,t))})}();

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

!function(){"use strict";String.prototype.padStart||(String.prototype.padStart=function(t,n){return t>>=0,n=String(n||" "),this.length>t?String(this):((t-=this.length)>n.length&&(n+=n.repeat(t/n.length)),n.slice(0,t)+String(this))})}();
!function(){String.prototype.padStart||(String.prototype.padStart=function(t,n){return t>>=0,n=String(n||" "),this.length>t?String(this):((t-=this.length)>n.length&&(n+=n.repeat(t/n.length)),n.slice(0,t)+String(this))})}();

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

!function(){"use strict";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})}();
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 @@

!function(){"use strict";String.prototype.startsWith||(String.prototype.startsWith=function(t,r){return r=r||0,this.substr(r,t.length)===t})}();
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