polyfills._DOMTokenList.min.js Maven / Gradle / Ivy
The newest version!
var _DOMTokenList=function(){function n(n){if(/^-?[_a-zA-Z]+[_a-zA-Z0-9-]*$/.test(n))return String(n);throw new Error("InvalidCharacterError: DOM Exception 5")}function t(n){for(var t,r=-1,i={};t=n[++r];)i[t]=!0;return i}function r(n,t){var r,i=[];for(r in t)t[r]&&i.push(r);[].splice.apply(n,[0,n.length].concat(i))}var i=function(){};return i.prototype={constructor:i,item:function(n){return this[parseFloat(n)]||null},length:Array.prototype.length,toString:function(){return[].join.call(this," ")},add:function(){for(var i,o=t(this),e=0;e in arguments;++e)i=n(arguments[e]),o[i]=!0;r(this,o)},contains:function(n){return n in t(this)},remove:function(){for(var i,o=t(this),e=0;e in arguments;++e)i=n(arguments[e]),o[i]=!1;r(this,o)},toggle:function(i){var o=t(this),e=1 in arguments?!arguments[1]:n(i)in o;return o[i]=!e,r(this,o),!e}},i}();