Comparing version 0.3.2 to 0.3.3
@@ -22,3 +22,3 @@ 'use strict'; | ||
if (!orphan) { | ||
node.removeAttributeNode(attributeNode); | ||
node.removeAttributeNodeNS(attributeNode); | ||
orphan = true; | ||
@@ -30,3 +30,3 @@ } | ||
if (orphan) { | ||
node.setAttributeNode(attributeNode); | ||
node.setAttributeNodeNS(attributeNode); | ||
orphan = false; | ||
@@ -33,0 +33,0 @@ } |
@@ -1,1 +0,1 @@ | ||
var uhtmlHandlers=function(t){"use strict";const{isArray:e}=Array;return t.aria=t=>e=>{for(const r in e)t.setAttribute("role"===r?r:"aria-"+r,e[r])},t.attribute=(t,e,r)=>{let n,o=!0;const s=document.createAttributeNS(r?"http://www.w3.org/2000/svg":null,e);return e=>{n!==e&&(n=e,null==n?o||(t.removeAttributeNode(s),o=!0):(s.value=e,o&&(t.setAttributeNode(s),o=!1)))}},t.data=({dataset:t})=>e=>{for(const r in e)t[r]=e[r]},t.event=(t,r)=>{let n,o=r.slice(2);return!(r in t)&&r.toLowerCase()in t&&(o=o.toLowerCase()),r=>{const s=e(r)?r:[r,!1];n!==s[0]&&(n&&t.removeEventListener(o,n,s[1]),(n=s[0])&&t.addEventListener(o,n,s[1]))}},t.ref=t=>e=>{"function"==typeof e?e(t):e.current=t},t.setter=(t,e)=>r=>{t[e]=r},t.text=t=>{let e;return r=>{e!=r&&(e=r,t.textContent=null==r?"":r)}},t}({}); | ||
var uhtmlHandlers=function(t){"use strict";const{isArray:e}=Array;return t.aria=t=>e=>{for(const r in e)t.setAttribute("role"===r?r:"aria-"+r,e[r])},t.attribute=(t,e,r)=>{let n,o=!0;const s=document.createAttributeNS(r?"http://www.w3.org/2000/svg":null,e);return e=>{n!==e&&(n=e,null==n?o||(t.removeAttributeNodeNS(s),o=!0):(s.value=e,o&&(t.setAttributeNodeNS(s),o=!1)))}},t.data=({dataset:t})=>e=>{for(const r in e)t[r]=e[r]},t.event=(t,r)=>{let n,o=r.slice(2);return!(r in t)&&r.toLowerCase()in t&&(o=o.toLowerCase()),r=>{const s=e(r)?r:[r,!1];n!==s[0]&&(n&&t.removeEventListener(o,n,s[1]),(n=s[0])&&t.addEventListener(o,n,s[1]))}},t.ref=t=>e=>{"function"==typeof e?e(t):e.current=t},t.setter=(t,e)=>r=>{t[e]=r},t.text=t=>{let e;return r=>{e!=r&&(e=r,t.textContent=null==r?"":r)}},t}({}); |
@@ -20,3 +20,3 @@ import {isArray} from 'uarray'; | ||
if (!orphan) { | ||
node.removeAttributeNode(attributeNode); | ||
node.removeAttributeNodeNS(attributeNode); | ||
orphan = true; | ||
@@ -28,3 +28,3 @@ } | ||
if (orphan) { | ||
node.setAttributeNode(attributeNode); | ||
node.setAttributeNodeNS(attributeNode); | ||
orphan = false; | ||
@@ -31,0 +31,0 @@ } |
@@ -25,3 +25,3 @@ var uhtmlHandlers = (function (exports) { | ||
if (!orphan) { | ||
node.removeAttributeNode(attributeNode); | ||
node.removeAttributeNodeNS(attributeNode); | ||
orphan = true; | ||
@@ -33,3 +33,3 @@ } | ||
if (orphan) { | ||
node.setAttributeNode(attributeNode); | ||
node.setAttributeNodeNS(attributeNode); | ||
orphan = false; | ||
@@ -36,0 +36,0 @@ } |
@@ -1,1 +0,1 @@ | ||
var uhtmlHandlers=function(t){"use strict";var i=Array.isArray;return t.aria=function(r){return function(t){for(var n in t)r.setAttribute("role"===n?n:"aria-".concat(n),t[n])}},t.attribute=function(n,t,r){var e,u=!0,i=document.createAttributeNS(r?"http://www.w3.org/2000/svg":null,t);return function(t){e!==t&&(null==(e=t)?u||(n.removeAttributeNode(i),u=!0):(i.value=t,u&&(n.setAttributeNode(i),u=!1)))}},t.data=function(t){var r=t.dataset;return function(t){for(var n in t)r[n]=t[n]}},t.event=function(r,t){var e,u=t.slice(2);return!(t in r)&&t.toLowerCase()in r&&(u=u.toLowerCase()),function(t){var n=i(t)?t:[t,!1];e!==n[0]&&(e&&r.removeEventListener(u,e,n[1]),(e=n[0])&&r.addEventListener(u,e,n[1]))}},t.ref=function(n){return function(t){"function"==typeof t?t(n):t.current=n}},t.setter=function(n,r){return function(t){n[r]=t}},t.text=function(n){var r;return function(t){r!=t&&(r=t,n.textContent=null==t?"":t)}},t}({}); | ||
var uhtmlHandlers=function(t){"use strict";var i=Array.isArray;return t.aria=function(r){return function(t){for(var n in t)r.setAttribute("role"===n?n:"aria-".concat(n),t[n])}},t.attribute=function(n,t,r){var e,u=!0,i=document.createAttributeNS(r?"http://www.w3.org/2000/svg":null,t);return function(t){e!==t&&(null==(e=t)?u||(n.removeAttributeNodeNS(i),u=!0):(i.value=t,u&&(n.setAttributeNodeNS(i),u=!1)))}},t.data=function(t){var r=t.dataset;return function(t){for(var n in t)r[n]=t[n]}},t.event=function(r,t){var e,u=t.slice(2);return!(t in r)&&t.toLowerCase()in r&&(u=u.toLowerCase()),function(t){var n=i(t)?t:[t,!1];e!==n[0]&&(e&&r.removeEventListener(u,e,n[1]),(e=n[0])&&r.addEventListener(u,e,n[1]))}},t.ref=function(n){return function(t){"function"==typeof t?t(n):t.current=n}},t.setter=function(n,r){return function(t){n[r]=t}},t.text=function(n){var r;return function(t){r!=t&&(r=t,n.textContent=null==t?"":t)}},t}({}); |
{ | ||
"name": "uhandlers", | ||
"version": "0.3.2", | ||
"version": "0.3.3", | ||
"description": "µhtml attributes handlers", | ||
@@ -26,6 +26,6 @@ "main": "./cjs/index.js", | ||
"ascjs": "^4.0.0", | ||
"basichtml": "^2.2.6", | ||
"basichtml": "^2.2.8", | ||
"coveralls": "^3.1.0", | ||
"nyc": "^15.0.1", | ||
"rollup": "^2.7.2", | ||
"rollup": "^2.7.3", | ||
"rollup-plugin-babel": "^4.4.0", | ||
@@ -32,0 +32,0 @@ "rollup-plugin-node-resolve": "^5.2.0", |
13197
227