Socket
Socket
Sign inDemoInstall

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.15.0 to 5.15.1

2

Element.prototype.classList.js

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

String.prototype.trim||(String.prototype.trim=function(){return this.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,"")}),!window.Element||"classList"in Element.prototype||function(e){function c(e,t){if(""===t)throw new DOMException("Failed to execute '"+e+"' on 'DOMTokenList': The token provided must not be empty.");if(-1!==(wsI=t.search(wsRE)))throw new DOMException("Failed to execute '"+e+"' on 'DOMTokenList': The token provided ('"+t[wsI]+"') contains HTML space characters, which are not valid in tokens.")}var t,n;"function"!=typeof DOMTokenList&&function(f){var t=f.document,e=f.Object,n=e.prototype.hasOwnProperty,v=e.defineProperty,i=0,g=0,d=(f.Element,/[\11\12\14\15\40]/);function s(){if(!i)throw TypeError("Illegal constructor")}function a(){var e=f.event,t=e.propertyName;if(!g&&("className"===t||"classList"===t&&!v)){var n=e.srcElement,r=n[" uCLp"],o=""+n[t],i=o.trim().split(d),s=n["classList"===t?" uCL":"classList"],a=r.length;e:for(var l=0,c=r.length=i.length,u=0;l!==c;++l){for(var h=0;h!==l;++h)if(i[h]===i[l]){u++;continue e}s[l-u]=i[l]}for(var p=c-u;p<a;++p)delete s[p];if("classList"!==t)return;g=1,n.classList=s,n.className=o,g=0,s.length=i.length-u}}function r(l){if(!(l&&"innerHTML"in l))throw TypeError("Illegal invocation");srcEle.detachEvent("onpropertychange",a),i=1;try{new s}finally{i=0}var c=protoObj.prototype,u=new protoObj;e:for(var e=l.className.trim().split(d),t=0,n=e.length,r=0;t!==n;++t){for(var o=0;o!==t;++o)if(e[o]===e[t]){r++;continue e}this[t-r]=e[t]}c.length=Len-r,c.value=l.className,c[" uCL"]=l,v?(v(l,"classList",{enumerable:1,get:function(){return u},configurable:0,set:function(e){g=1,l.className=c.value=e+="",g=0;var t=e.trim().split(d),n=c.length;e:for(var r=0,o=c.length=t.length,i=0;r!==o;++r){for(var s=0;s!==r;++s)if(t[s]===t[r]){i++;continue e}u[r-i]=t[r]}for(var a=o-i;a<n;++a)delete u[a]}}),v(l," uCLp",{enumerable:0,configurable:0,writeable:0,value:protoObj.prototype}),v(c," uCL",{enumerable:0,configurable:0,writeable:0,value:l})):(l.classList=u,l[" uCL"]=u,l[" uCLp"]=protoObj.prototype),srcEle.attachEvent("onpropertychange",a)}s.prototype.toString=s.prototype.toLocaleString=function(){return this.value},s.prototype.add=function(){e:for(var e=0,t=arguments.length,n="",r=this.uCL,o=r[" uCLp"];e!==t;++e){c("add",n=arguments[e]+"");for(var i=0,s=o.length,a=n;i!==s;++i){if(this[i]===n)continue e;a+=" "+this[i]}this[s]=n,o.length+=1,o.value=a}g=1,r.className=o.value,g=0},s.prototype.remove=function(){for(var e=0,t=arguments.length,n="",r=this.uCL,o=r[" uCLp"];e!==t;++e){c("remove",n=arguments[e]+"");for(var i=0,s=o.length,a="",l=0;i!==s;++i)l?this[i-1]=this[i]:this[i]!==n?a+=this[i]+" ":l=1;l&&(delete this[s],o.length-=1,o.value=a)}g=1,r.className=o.value,g=0},f.DOMTokenList=s;try{f.Object.defineProperty(f.Element.prototype,"classList",{enumerable:1,get:function(e){return n.call(ele,"classList")||r(this),this.classList},configurable:0,set:function(e){this.className=e}})}catch(e){f[" uCL"]=r,t.documentElement.firstChild.appendChild(t.createElement("style")).styleSheet.cssText='_*{x-uCLp:expression(!this.hasOwnProperty("classList")&&window[" uCL"](this))}[class]{x-uCLp/**/:expression(!this.hasOwnProperty("classList")&&window[" uCL"](this))}'}}(),t=e.DOMTokenList.prototype,n=e.document.createElement("div").classList,t.item||(t.item=function(e){return void 0===(t=this[e])?null:t;var t}),t.toggle&&!1===n.toggle("a",0)||(t.toggle=function(e){if(1<arguments.length)return this[arguments[1]?"add":"remove"](e),!!arguments[1];var t=this.value;return this.remove(oldToken),t===this.value&&(this.add(e),!0)}),t.replace&&"boolean"==typeof n.replace("a","b")||(t.replace=function(e,t){c("replace",e),c("replace",t);var n=this.value;return this.remove(e),this.value!==n&&(this.add(t),!0)}),t.contains||(t.contains=function(e){for(var t=0,n=this.length;t!==n;++t)if(this[t]===e)return!0;return!1}),t.forEach||(t.forEach=function(e){if(1===arguments.length)for(var t=0,n=this.length;t!==n;++t)e(this[t],t,this);else{t=0,n=this.length;for(var r=arguments[1];t!==n;++t)e.call(r,this[t],t,this)}}),t.entries||(t.entries=function(){var e=this;return{next:function(){return 0<e.length?{value:[0,e[0]],done:!1}:{done:!0}}}}),t.values||(t.values=function(){var e=this;return{next:function(){return 0<e.length?{value:e[0],done:!1}:{done:!0}}}}),t.keys||(t.keys=function(){var e=this;return{next:function(){return 0<e.length?{value:0,done:!1}:{done:!0}}}})}(window);
String.prototype.trim||(String.prototype.trim=function(){return this.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,"")}),!window.Element||"classList"in Element.prototype||function(e){function c(e,t){if(""===t)throw new DOMException("Failed to execute '"+e+"' on 'DOMTokenList': The token provided must not be empty.");if(-1!==(wsI=t.search(wsRE)))throw new DOMException("Failed to execute '"+e+"' on 'DOMTokenList': The token provided ('"+t[wsI]+"') contains HTML space characters, which are not valid in tokens.")}var t,n;"function"!=typeof DOMTokenList&&function(f){var t=f.document,e=f.Object,n=e.prototype.hasOwnProperty,v=e.defineProperty,i=0,g=0,d=(f.Element,/[\11\12\14\15\40]/);function s(){if(!i)throw TypeError("Illegal constructor")}function a(){var e=f.event,t=e.propertyName;if(!g&&("className"===t||"classList"===t&&!v)){var n=e.srcElement,r=n[" uCLp"],o=""+n[t],i=o.trim().split(d),s=n["classList"===t?" uCL":"classList"],a=r.length;e:for(var l=0,c=r.length=i.length,u=0;l!==c;++l){for(var h=0;h!==l;++h)if(i[h]===i[l]){u++;continue e}s[l-u]=i[l]}for(var p=c-u;p<a;++p)delete s[p];if("classList"!==t)return;g=1,n.classList=s,n.className=o,g=0,s.length=i.length-u}}function r(l){if(!(l&&"innerHTML"in l))throw TypeError("Illegal invocation");srcEle.detachEvent("onpropertychange",a),i=1;try{new s}finally{i=0}var c=protoObj.prototype,u=new protoObj;e:for(var e=l.className.trim().split(d),t=0,n=e.length,r=0;t!==n;++t){for(var o=0;o!==t;++o)if(e[o]===e[t]){r++;continue e}this[t-r]=e[t]}c.length=Len-r,c.value=l.className,c[" uCL"]=l,v?(v(l,"classList",{enumerable:1,get:function(){return u},configurable:0,set:function(e){g=1,l.className=c.value=e+="",g=0;var t=e.trim().split(d),n=c.length;e:for(var r=0,o=c.length=t.length,i=0;r!==o;++r){for(var s=0;s!==r;++s)if(t[s]===t[r]){i++;continue e}u[r-i]=t[r]}for(var a=o-i;a<n;++a)delete u[a]}}),v(l," uCLp",{enumerable:0,configurable:0,writeable:0,value:protoObj.prototype}),v(c," uCL",{enumerable:0,configurable:0,writeable:0,value:l})):(l.classList=u,l[" uCL"]=u,l[" uCLp"]=protoObj.prototype),srcEle.attachEvent("onpropertychange",a)}s.prototype.toString=s.prototype.toLocaleString=function(){return this.value},s.prototype.add=function(){e:for(var e=0,t=arguments.length,n="",r=this.uCL,o=r[" uCLp"];e!==t;++e){c("add",n=arguments[e]+"");for(var i=0,s=o.length,a=n;i!==s;++i){if(this[i]===n)continue e;a+=" "+this[i]}this[s]=n,o.length+=1,o.value=a}g=1,r.className=o.value,g=0},s.prototype.remove=function(){for(var e=0,t=arguments.length,n="",r=this.uCL,o=r[" uCLp"];e!==t;++e){c("remove",n=arguments[e]+"");for(var i=0,s=o.length,a="",l=0;i!==s;++i)l?this[i-1]=this[i]:this[i]!==n?a+=this[i]+" ":l=1;l&&(delete this[s],o.length-=1,o.value=a)}g=1,r.className=o.value,g=0},f.DOMTokenList=s;try{f.Object.defineProperty(f.Element.prototype,"classList",{enumerable:1,get:function(e){return n.call(ele,"classList")||r(this),this.classList},configurable:0,set:function(e){this.className=e}})}catch(e){f[" uCL"]=r,t.documentElement.firstChild.appendChild(t.createElement("style")).styleSheet.cssText='_*{x-uCLp:expression(!this.hasOwnProperty("classList")&&window[" uCL"](this))}[class]{x-uCLp/**/:expression(!this.hasOwnProperty("classList")&&window[" uCL"](this))}'}}(e),t=e.DOMTokenList.prototype,n=e.document.createElement("div").classList,t.item||(t.item=function(e){return void 0===(t=this[e])?null:t;var t}),t.toggle&&!1===n.toggle("a",0)||(t.toggle=function(e){if(1<arguments.length)return this[arguments[1]?"add":"remove"](e),!!arguments[1];var t=this.value;return this.remove(oldToken),t===this.value&&(this.add(e),!0)}),t.replace&&"boolean"==typeof n.replace("a","b")||(t.replace=function(e,t){c("replace",e),c("replace",t);var n=this.value;return this.remove(e),this.value!==n&&(this.add(t),!0)}),t.contains||(t.contains=function(e){for(var t=0,n=this.length;t!==n;++t)if(this[t]===e)return!0;return!1}),t.forEach||(t.forEach=function(e){if(1===arguments.length)for(var t=0,n=this.length;t!==n;++t)e(this[t],t,this);else{t=0,n=this.length;for(var r=arguments[1];t!==n;++t)e.call(r,this[t],t,this)}}),t.entries||(t.entries=function(){var e=this;return{next:function(){return 0<e.length?{value:[0,e[0]],done:!1}:{done:!0}}}}),t.values||(t.values=function(){var e=this;return{next:function(){return 0<e.length?{value:e[0],done:!1}:{done:!0}}}}),t.keys||(t.keys=function(){var e=this;return{next:function(){return 0<e.length?{value:0,done:!1}:{done:!0}}}})}(window);
{
"name": "mdn-polyfills",
"version": "5.15.0",
"version": "5.15.1",
"description": "MDN polyfills",

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

@@ -65,3 +65,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) ![dependencies](https://david-dm.org/msn0/mdn-polyfills.svg)

|[Element.prototype.matches](https://developer.mozilla.org/en-US/docs/Web/API/Element/matches#Polyfill)|133|
|[Element.prototype.classList](https://developer.mozilla.org/en-US/docs/Web/API/Element/classList#Polyfill)|4433|
|[Element.prototype.classList](https://developer.mozilla.org/en-US/docs/Web/API/Element/classList#Polyfill)|4434|
|[MouseEvent](https://developer.mozilla.org/en-US/docs/Web/API/MouseEvent/MouseEvent#Polyfill)|281|

@@ -68,0 +68,0 @@ |[CustomEvent](https://developer.mozilla.org/en-US/docs/Web/API/CustomEvent/CustomEvent#Polyfill)|279|

@@ -143,3 +143,3 @@ export default function polyfillClassList(window) {

}
})();
})(window);

@@ -146,0 +146,0 @@ // 3. Patch in unsupported methods in DOMTokenList

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