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.9.0 to 5.10.0

Number.isNaN.js

2

Array.from.js

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

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

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

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

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

!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})}();
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});

@@ -1,1 +0,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}})}();
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(){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++}})}();
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(1<arguments.length&&(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(){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})}();
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,i=parseInt(arguments[1],10)||0;for(0<=i?t=i:(t=n+i)<0&&(t=0);t<n;){if(r===(o=e[t])||r!=r&&o!=o)return!0;t++}return!1});

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

!function(){Array.prototype.some||(Array.prototype.some=function(r,o){if(null==this)throw new TypeError("Array.prototype.some called on null or undefined");if("function"!=typeof r)throw new TypeError(r+" is not a function");for(var n=Object(this),t=n.length>>>0,e=(o=arguments.length>=2?arguments[1]:void 0,0);e<t;e++)if(e in n&&r.call(o,n[e],e,n))return!0;return!1})}();
Array.prototype.some||(Array.prototype.some=function(r,o){if(null==this)throw new TypeError("Array.prototype.some called on null or undefined");if("function"!=typeof r)throw new TypeError(r+" is not a function");for(var t=Object(this),e=t.length>>>0,n=(o=2<=arguments.length?o:void 0,0);n<e;n++)if(n in t&&r.call(o,t[n],n,t))return!0;return!1});

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

!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}()}();
!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}"function"!=typeof window.CustomEvent&&(t.prototype=window.Event.prototype,window.CustomEvent=t)}();

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

!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})}();
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;0<=--t&&o.item(t)!==n;);}while(t<0&&(n=n.parentElement));return n});

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

!function(){window.Element&&!Element.prototype.toggleAttribute&&(Element.prototype.toggleAttribute=function(t,e){var i=!!e,n=2===arguments.length&&!e;return null!==this.getAttribute(t)?!!i||(this.removeAttribute(t),!1):!n&&(this.setAttribute(t,""),!0)})}();
window.Element&&!Element.prototype.toggleAttribute&&(Element.prototype.toggleAttribute=function(t,e){var r=!!e,i=2===arguments.length&&!e;return null!==this.getAttribute(t)?!!r||(this.removeAttribute(t),!1):!i&&(this.setAttribute(t,""),!0)});

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

!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})}();
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(){!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}()}();
!function(){try{return new e("test")}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(){function e(){var e=Array.prototype.slice.call(arguments),t=document.createDocumentFragment();e.forEach(function(e){var n=e instanceof Node;t.appendChild(n?e:document.createTextNode(String(e)))}),this.appendChild(t)}[Element.prototype,Document.prototype,DocumentFragment.prototype].forEach(function(t){t.hasOwnProperty("append")||Object.defineProperty(t,"append",{configurable:!0,enumerable:!0,writable:!0,value:e})})}();
!function(){function t(){var e=Array.prototype.slice.call(arguments),n=document.createDocumentFragment();e.forEach(function(e){var t=e instanceof Node;n.appendChild(t?e:document.createTextNode(String(e)))}),this.appendChild(n)}[Element.prototype,Document.prototype,DocumentFragment.prototype].forEach(function(e){e.hasOwnProperty("append")||Object.defineProperty(e,"append",{configurable:!0,enumerable:!0,writable:!0,value:t})})}();

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

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

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

!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}}())}();
!function(){var r,o;"function"!=typeof Object.create&&(Object.create=(o=function(){},function(t,e){if(t!==Object(t))throw TypeError("Argument must be an object, or null");o.prototype=t||{};var n=new o;return o.prototype=null,e!==r&&Object.defineProperties(n,e),null===t&&(n.__proto__=null),n}))}();

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

!function(){"function"!=typeof Object.entries&&(Object.entries=function(e){for(var n=Object.keys(e),t=n.length,r=new Array(t);t--;)r[t]=[n[t],e[n[t]]];return r})}();
"function"!=typeof Object.entries&&(Object.entries=function(e){for(var t=Object.keys(e),n=t.length,r=new Array(n);n--;)r[n]=[t[n],e[t[n]]];return r});
{
"name": "mdn-polyfills",
"version": "5.9.0",
"version": "5.10.0",
"description": "MDN polyfills",

@@ -32,2 +32,3 @@ "scripts": {

"matches",
"isNaN",
"Object.assign",

@@ -58,2 +59,3 @@ "Object.create",

"CustomEvent",
"Number.isNaN",
"polyfills",

@@ -77,5 +79,5 @@ "polyfill",

"eslint-config-helmut": "^3.0.0",
"rollup": "^0.59.0",
"rollup-plugin-babel": "^3.0.4",
"rollup-plugin-uglify": "^3.0.0",
"rollup": "^0.64.1",
"rollup-plugin-babel": "^3.0.7",
"rollup-plugin-uglify": "^4.0.0",
"tap-nyan": "^1.1.0"

@@ -82,0 +84,0 @@ },

@@ -18,3 +18,3 @@ [https://msn0.github.io/mdn-polyfills](https://msn0.github.io/mdn-polyfills)

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

@@ -25,3 +25,3 @@

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

@@ -32,3 +32,3 @@

```js
import 'mdn-polyfills/Object.entries'; // 166 bytes
import 'mdn-polyfills/Object.entries'; // 151 bytes
```

@@ -39,3 +39,3 @@

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

@@ -46,3 +46,3 @@

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

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

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

@@ -61,3 +61,3 @@

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

@@ -68,3 +68,3 @@

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

@@ -75,3 +75,3 @@

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

@@ -82,3 +82,3 @@

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

@@ -89,3 +89,3 @@

```js
import 'mdn-polyfills/Array.prototype.some'; // 372 bytes
import 'mdn-polyfills/Array.prototype.some'; // 346 bytes
```

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

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

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

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

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

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

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

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

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

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

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

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

@@ -156,3 +156,3 @@

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

@@ -163,3 +163,3 @@

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

@@ -170,3 +170,3 @@

```js
import 'mdn-polyfills/Element.prototype.toggleAttribute'; // 258 bytes
import 'mdn-polyfills/Element.prototype.toggleAttribute'; // 243 bytes
```

@@ -183,3 +183,3 @@

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

@@ -190,5 +190,11 @@

```js
import 'mdn-polyfills/CustomEvent'; // 303 bytes
import 'mdn-polyfills/CustomEvent'; // 279 bytes
```
### [Number.isNaN](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number/isNaN#Polyfill)
```js
import 'mdn-polyfills/Number.isNaN'; // 53 bytes
```
# License

@@ -195,0 +201,0 @@

const babelrc = require('babelrc-rollup').default;
const babel = require('rollup-plugin-babel');
const uglify = require('rollup-plugin-uglify');
const { uglify } = require('rollup-plugin-uglify');
const rollup = require('rollup').rollup;

@@ -51,1 +51,2 @@

rollup(input('./src/CustomEvent/index.js')).then(output('./CustomEvent.js'));
rollup(input('./src/Number.isNaN/index.js')).then(output('./Number.isNaN.js'));

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

!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})}();
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(){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))})}();
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(){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))})}();
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(){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(){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