Socket
Socket
Sign inDemoInstall

undom

Package Overview
Dependencies
Maintainers
1
Versions
8
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

undom - npm Package Compare versions

Comparing version 0.3.2 to 0.3.3

11

dist/undom.js

@@ -126,5 +126,16 @@ (function (global, factory) {

function Element(nodeType, nodeName) {
var this$1 = this;
Node.call(this, nodeType || 1, nodeName); // ELEMENT_NODE
this.attributes = [];
this.__handlers = {};
this.style = {};
Object.defineProperty(this, 'className', {
set: function (val) { this$1.setAttribute('class', val); },
get: function () { return this$1.getAttribute('class'); }
});
Object.defineProperty(this.style, 'cssText', {
set: function (val) { this$1.setAttribute('style', val); },
get: function () { return this$1.getAttribute('style'); }
});
}

@@ -131,0 +142,0 @@

2

dist/undom.min.js

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

!function(t,e){"object"==typeof exports&&"undefined"!=typeof module?module.exports=e():"function"==typeof define&&define.amd?define(e):t.undom=e()}(this,function(){function t(t,e){for(var n in e)t[n]=e[n]}function e(t){return String(t).toLowerCase()}function n(t,e,n,r){var i=t?o(t,e,!0,r):-1;return~i&&(n?t.splice(i,0,n):t.splice(i,1)),i}function o(t,e,n,o){for(var r=t.length;r--&&("function"!=typeof e||o?t[r]!==e:!e(t[r])););return n?r:t[r]}function r(t,n){return function(o){return o.ns===t&&e(o.name)===e(n)}}function i(){function i(t){return 1===t.nodeType}function u(t){return new a(null,String(t).toUpperCase())}function s(t,e){var n=u(e);return n.namespace=t,n}function p(t){return new l(t)}function c(){var e=new f;return t(e,e.defaultView={document:e,Document:f,Node:d,Text:l,Element:a,SVGElement:a,Event:b}),t(e,{documentElement:e,createElement:u,createElementNS:s,createTextNode:p}),e.appendChild(e.body=u("body")),e}var d=function(t,e){this.nodeType=t,this.nodeName=e,this.childNodes=[]},h={nextSibling:{},previousSibling:{},firstChild:{},lastChild:{}};h.nextSibling.get=function(){var t=this.parentNode;if(t)return t.childNodes[o(t.childNodes,this,!0)+1]},h.previousSibling.get=function(){var t=this.parentNode;if(t)return t.childNodes[o(t.childNodes,this,!0)-1]},h.firstChild.get=function(){return this.childNodes[0]},h.lastChild.get=function(){return this.childNodes[this.childNodes.length-1]},d.prototype.appendChild=function(t){this.insertBefore(t)},d.prototype.insertBefore=function(t,e){t.remove(),t.parentNode=this,e?n(this.childNodes,e,t):this.childNodes.push(t)},d.prototype.replaceChild=function(t,e){e.parentNode===this&&(this.insertBefore(t,e),e.remove())},d.prototype.removeChild=function(t){n(this.childNodes,t)},d.prototype.remove=function(){this.parentNode&&this.parentNode.removeChild(this)},Object.defineProperties(d.prototype,h);var l=function(t){function e(e){t.call(this,3,"#text"),this.nodeValue=e}t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e;var n={textContent:{}};return n.textContent.set=function(t){this.nodeValue=t},n.textContent.get=function(){return this.nodeValue},Object.defineProperties(e.prototype,n),e}(d),a=function(t){function u(e,n){t.call(this,e||1,n),this.attributes=[],this.__handlers={}}t&&(u.__proto__=t),u.prototype=Object.create(t&&t.prototype),u.prototype.constructor=u;var s={children:{}};return s.children.get=function(){return this.childNodes.filter(i)},u.prototype.setAttribute=function(t,e){this.setAttributeNS(null,t,e)},u.prototype.getAttribute=function(t){return this.getAttributeNS(null,t)},u.prototype.removeAttribute=function(t){this.removeAttributeNS(null,t)},u.prototype.setAttributeNS=function(t,e,n){var i=o(this.attributes,r(t,e));i||this.attributes.push(i={ns:t,name:e}),i.value=String(n)},u.prototype.getAttributeNS=function(t,e){var n=o(this.attributes,r(t,e));return n&&n.value},u.prototype.removeAttributeNS=function(t,e){n(this.attributes,r(t,e))},u.prototype.addEventListener=function(t,n){(this.__handlers[e(t)]||(this.__handlers[e(t)]=[])).push(n)},u.prototype.removeEventListener=function(t,o){n(this.__handlers[e(t)],o,0,!0)},u.prototype.dispatchEvent=function(t){var n,o,r=t.currentTarget=this,i=t.cancelable;do if(n=r.__handlers&&r.__handlers[e(t.type)])for(o=n.length;o--&&(n[o].call(r,t)!==!1&&!t._end||!i););while(t.bubbles&&(!i||!t._stop)&&(t.target=r=r.parentNode));return!t.defaultPrevented},Object.defineProperties(u.prototype,s),u}(d),f=function(t){function e(){t.call(this,9,"#document")}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e}(a),b=function(t,e){this.type=t,this.bubbles=!!e.bubbles,this.cancelable=!!e.cancelable};return b.prototype.stopPropagation=function(){this._stop=!0},b.prototype.stopImmediatePropagation=function(){this._end=this._stop=!0},b.prototype.preventDefault=function(){this.defaultPrevented=!0},c()}return i});
!function(t,e){"object"==typeof exports&&"undefined"!=typeof module?module.exports=e():"function"==typeof define&&define.amd?define(e):t.undom=e()}(this,function(){function t(t,e){for(var n in e)t[n]=e[n]}function e(t){return String(t).toLowerCase()}function n(t,e,n,r){var i=t?o(t,e,!0,r):-1;return~i&&(n?t.splice(i,0,n):t.splice(i,1)),i}function o(t,e,n,o){for(var r=t.length;r--&&("function"!=typeof e||o?t[r]!==e:!e(t[r])););return n?r:t[r]}function r(t,n){return function(o){return o.ns===t&&e(o.name)===e(n)}}function i(){function i(t){return 1===t.nodeType}function s(t){return new a(null,String(t).toUpperCase())}function u(t,e){var n=s(e);return n.namespace=t,n}function c(t){return new h(t)}function p(){var e=new f;return t(e,e.defaultView={document:e,Document:f,Node:l,Text:h,Element:a,SVGElement:a,Event:b}),t(e,{documentElement:e,createElement:s,createElementNS:u,createTextNode:c}),e.appendChild(e.body=s("body")),e}var l=function(t,e){this.nodeType=t,this.nodeName=e,this.childNodes=[]},d={nextSibling:{},previousSibling:{},firstChild:{},lastChild:{}};d.nextSibling.get=function(){var t=this.parentNode;if(t)return t.childNodes[o(t.childNodes,this,!0)+1]},d.previousSibling.get=function(){var t=this.parentNode;if(t)return t.childNodes[o(t.childNodes,this,!0)-1]},d.firstChild.get=function(){return this.childNodes[0]},d.lastChild.get=function(){return this.childNodes[this.childNodes.length-1]},l.prototype.appendChild=function(t){this.insertBefore(t)},l.prototype.insertBefore=function(t,e){t.remove(),t.parentNode=this,e?n(this.childNodes,e,t):this.childNodes.push(t)},l.prototype.replaceChild=function(t,e){e.parentNode===this&&(this.insertBefore(t,e),e.remove())},l.prototype.removeChild=function(t){n(this.childNodes,t)},l.prototype.remove=function(){this.parentNode&&this.parentNode.removeChild(this)},Object.defineProperties(l.prototype,d);var h=function(t){function e(e){t.call(this,3,"#text"),this.nodeValue=e}t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e;var n={textContent:{}};return n.textContent.set=function(t){this.nodeValue=t},n.textContent.get=function(){return this.nodeValue},Object.defineProperties(e.prototype,n),e}(l),a=function(t){function s(e,n){var o=this;t.call(this,e||1,n),this.attributes=[],this.__handlers={},this.style={},Object.defineProperty(this,"className",{set:function(t){o.setAttribute("class",t)},get:function(){return o.getAttribute("class")}}),Object.defineProperty(this.style,"cssText",{set:function(t){o.setAttribute("style",t)},get:function(){return o.getAttribute("style")}})}t&&(s.__proto__=t),s.prototype=Object.create(t&&t.prototype),s.prototype.constructor=s;var u={children:{}};return u.children.get=function(){return this.childNodes.filter(i)},s.prototype.setAttribute=function(t,e){this.setAttributeNS(null,t,e)},s.prototype.getAttribute=function(t){return this.getAttributeNS(null,t)},s.prototype.removeAttribute=function(t){this.removeAttributeNS(null,t)},s.prototype.setAttributeNS=function(t,e,n){var i=o(this.attributes,r(t,e));i||this.attributes.push(i={ns:t,name:e}),i.value=String(n)},s.prototype.getAttributeNS=function(t,e){var n=o(this.attributes,r(t,e));return n&&n.value},s.prototype.removeAttributeNS=function(t,e){n(this.attributes,r(t,e))},s.prototype.addEventListener=function(t,n){(this.__handlers[e(t)]||(this.__handlers[e(t)]=[])).push(n)},s.prototype.removeEventListener=function(t,o){n(this.__handlers[e(t)],o,0,!0)},s.prototype.dispatchEvent=function(t){var n,o,r=t.currentTarget=this,i=t.cancelable;do if(n=r.__handlers&&r.__handlers[e(t.type)])for(o=n.length;o--&&(n[o].call(r,t)!==!1&&!t._end||!i););while(t.bubbles&&(!i||!t._stop)&&(t.target=r=r.parentNode));return!t.defaultPrevented},Object.defineProperties(s.prototype,u),s}(l),f=function(t){function e(){t.call(this,9,"#document")}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e}(a),b=function(t,e){this.type=t,this.bubbles=!!e.bubbles,this.cancelable=!!e.cancelable};return b.prototype.stopPropagation=function(){this._stop=!0},b.prototype.stopImmediatePropagation=function(){this._end=this._stop=!0},b.prototype.preventDefault=function(){this.defaultPrevented=!0},p()}return i});
//# sourceMappingURL=undom.min.js.map
{
"name": "undom",
"amdName": "undom",
"version": "0.3.2",
"version": "0.3.3",
"description": "Minimally viable DOM Document implementation.",

@@ -6,0 +6,0 @@ "main": "dist/undom.js",

@@ -95,2 +95,11 @@ import {

this.__handlers = {};
this.style = {};
Object.defineProperty(this, 'className', {
set: val => { this.setAttribute('class', val); },
get: () => this.getAttribute('class')
});
Object.defineProperty(this.style, 'cssText', {
set: val => { this.setAttribute('style', val); },
get: () => this.getAttribute('style')
});
}

@@ -97,0 +106,0 @@

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

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