@gera2ld/jsx-dom
Advanced tools
Comparing version 1.1.0 to 1.1.1
@@ -1,6 +0,4 @@ | ||
/*! @gera2ld/jsx-dom v1.1.0 | ISC License */ | ||
/*! @gera2ld/jsx-dom v1.1.1 | ISC License */ | ||
'use strict'; | ||
Object.defineProperty(exports, '__esModule', { value: true }); | ||
var propRules = ['innerHTML', 'innerText', 'textContent', { | ||
@@ -7,0 +5,0 @@ key: 'value', |
@@ -1,2 +0,2 @@ | ||
/*! @gera2ld/jsx-dom v1.1.0 | ISC License */ | ||
/*! @gera2ld/jsx-dom v1.1.1 | ISC License */ | ||
var JSX = (function (exports) { | ||
@@ -3,0 +3,0 @@ 'use strict'; |
@@ -1,2 +0,2 @@ | ||
/*! @gera2ld/jsx-dom v1.1.0 | ISC License */ | ||
/*! @gera2ld/jsx-dom v1.1.1 | ISC License */ | ||
var JSX=function(e){"use strict";var c=["innerHTML","innerText","textContent",{key:"value",tag:"textarea"}],i={name:"Fragment"};function f(t,e){Array.isArray(e)?e.forEach(function(e){return f(t,e)}):null!=e&&!1!==e&&("object"!=typeof e?t.appendChild(document.createTextNode(""+e)):t.appendChild(e))}return e.Fragment=i,e.createElement=function(n,r){var o,a;if(n===i)o=document.createDocumentFragment();else{if("string"!=typeof n)throw new Error("Invalid element type: "+n);o=document.createElement(n),r&&Object.keys(r).forEach(function(e){var t=r[e];null!=t&&(e.startsWith("on")?o.addEventListener(e.slice(2).toLowerCase(),t):"children"===e?f(o,t):"style"===e&&"object"==typeof t?function(n,r){Object.keys(r).forEach(function(e){var t=r[e];n.style[e]="number"==typeof t?t+"px":t})}(o,t):"dangerouslySetInnerHTML"===e&&t?o.innerHTML=t.__html||"":"ref"===e&&"function"==typeof t?a=t:"boolean"==typeof t?t?o.setAttribute(e,e):o.removeAttribute(e):function(e,r,o){return c.some(function(t){if(!t)return!1;if("string"==typeof t)return r===t;var n={tag:e,key:r,value:o};return Object.keys(t).every(function(e){return t[e]===n[e]})})}(n,e,t)?o[e]=t:("className"===e?e="class":"labelFor"===e&&(e="for"),o.setAttribute(e,""+t)))})}for(var e=arguments.length,t=new Array(2<e?e-2:0),u=2;u<e;u++)t[u-2]=arguments[u];return f(o,t),a&&a(o),o},e}({}); |
{ | ||
"name": "@gera2ld/jsx-dom", | ||
"version": "1.1.0", | ||
"version": "1.1.1", | ||
"description": "Use JSX for HTML elements.", | ||
@@ -5,0 +5,0 @@ "author": "Gerald <i@gerald.top>", |
9275
188