jsx-dom-runtime
Advanced tools
Comparing version 0.16.0 to 0.17.0
let appendChildren = (node, children) => { | ||
if (Array.isArray(children)) { | ||
children.forEach(child => { | ||
appendChildren(node, child); | ||
}); | ||
children.forEach(child => appendChildren(node, child)); | ||
} else if (children != null && children !== false) { | ||
node.appendChild(children.nodeType > 0 ? children : document.createTextNode(children)); | ||
node.append(children); | ||
} | ||
@@ -81,3 +79,3 @@ }; | ||
let Fragment = props => { | ||
let fragment = document.createDocumentFragment(); | ||
let fragment = new DocumentFragment(); | ||
appendChildren(fragment, props.children); | ||
@@ -84,0 +82,0 @@ return fragment; |
@@ -1,1 +0,1 @@ | ||
let e=(t,r)=>{Array.isArray(r)?r.forEach((r=>{e(t,r)})):null!=r&&!1!==r&&t.appendChild(r.nodeType>0?r:document.createTextNode(r))},t=t=>{let r=document.createDocumentFragment();return e(r,t.children),r},r=new Map,n=e=>{for(let t in e)r.set(t,e[t])},o=new Set(["className","innerHTML","textContent","value","htmlFor"]),l=(t,n)=>{let l,s;if("function"==typeof t)return t(n);for(l in t="string"==typeof t?document.createElement(t):t,n)if("ref"!==l&&"children"!==l)if(s=n[l],r.has(l))r.get(l)(t,s);else if(o.has(l))t[l]=s;else if("style"===l)if("string"==typeof s)t.style.cssText=s;else for(l in s)"-"===l[0]?t.style.setProperty(l,s[l]):t.style[l]=s[l];else"o"===l[0]&&"n"===l[1]?(l=l.toLowerCase(),l in t&&(t[l]=s)):null!=s?"boolean"!=typeof s||/^(ari|dat)a-/.test(l)?t.setAttribute(l,s):s?t.setAttribute(l,""):t.removeAttribute(l):t.removeAttribute(l);return e("TEMPLATE"===t.tagName?t.content:t,n.children),s=n.ref,null!=s&&("function"==typeof s?s(t):s.current=t),t};export{n as Extend,t as Fragment,l as jsx,l as jsxs}; | ||
let e=(t,r)=>{Array.isArray(r)?r.forEach((r=>e(t,r))):null!=r&&!1!==r&&t.append(r)},t=t=>{let r=new DocumentFragment;return e(r,t.children),r},r=new Map,n=e=>{for(let t in e)r.set(t,e[t])},l=new Set(["className","innerHTML","textContent","value","htmlFor"]),s=(t,n)=>{let s,o;if("function"==typeof t)return t(n);for(s in t="string"==typeof t?document.createElement(t):t,n)if("ref"!==s&&"children"!==s)if(o=n[s],r.has(s))r.get(s)(t,o);else if(l.has(s))t[s]=o;else if("style"===s)if("string"==typeof o)t.style.cssText=o;else for(s in o)"-"===s[0]?t.style.setProperty(s,o[s]):t.style[s]=o[s];else"o"===s[0]&&"n"===s[1]?(s=s.toLowerCase(),s in t&&(t[s]=o)):null!=o?"boolean"!=typeof o||/^(ari|dat)a-/.test(s)?t.setAttribute(s,o):o?t.setAttribute(s,""):t.removeAttribute(s):t.removeAttribute(s);return e("TEMPLATE"===t.tagName?t.content:t,n.children),o=n.ref,null!=o&&("function"==typeof o?o(t):o.current=t),t};export{n as Extend,t as Fragment,s as jsx,s as jsxs}; |
{ | ||
"name": "jsx-dom-runtime", | ||
"version": "0.16.0", | ||
"version": "0.17.0", | ||
"description": "A tiny in 500 bytes library to JSX syntax templates for DOM", | ||
@@ -39,6 +39,7 @@ "main": "dist/index.cjs", | ||
"posttest": "npm run lint && size-limit", | ||
"publish": "clean-publish", | ||
"size": "npm run build && size-limit" | ||
}, | ||
"dependencies": { | ||
"@babel/core": "^7.15.5", | ||
"@babel/core": "^7.15.8", | ||
"@babel/helper-plugin-utils": "^7.14.5", | ||
@@ -49,17 +50,18 @@ "@babel/plugin-transform-react-jsx": "^7.14.9", | ||
"devDependencies": { | ||
"@babel/preset-env": "^7.15.6", | ||
"@babel/preset-env": "^7.15.8", | ||
"@babel/preset-typescript": "^7.15.0", | ||
"@rollup/plugin-babel": "^5.3.0", | ||
"@rollup/plugin-commonjs": "^20.0.0", | ||
"@rollup/plugin-commonjs": "^21.0.0", | ||
"@rollup/plugin-node-resolve": "^13.0.5", | ||
"@size-limit/preset-small-lib": "^5.0.5", | ||
"@testing-library/dom": "^8.7.0", | ||
"@testing-library/dom": "^8.7.2", | ||
"@testing-library/jest-dom": "^5.14.1", | ||
"@types/testing-library__jest-dom": "^5.14.1", | ||
"@typescript-eslint/eslint-plugin": "^4.32.0", | ||
"@typescript-eslint/parser": "^4.32.0", | ||
"babel-jest": "^27.2.4", | ||
"@typescript-eslint/eslint-plugin": "^4.33.0", | ||
"@typescript-eslint/parser": "^4.33.0", | ||
"babel-jest": "^27.2.5", | ||
"clean-publish": "^3.4.0", | ||
"eslint": "^7.32.0", | ||
"jest": "^27.2.4", | ||
"rollup": "^2.57.0", | ||
"jest": "^27.2.5", | ||
"rollup": "^2.58.0", | ||
"rollup-plugin-terser": "^7.0.2", | ||
@@ -87,7 +89,7 @@ "simple-git-hooks": "^2.6.1", | ||
"path": "jsx-runtime/index.js", | ||
"limit": "497 B" | ||
"limit": "473 B" | ||
}, | ||
{ | ||
"path": "jsx-runtime/index.cjs", | ||
"limit": "480 B" | ||
"limit": "455 B" | ||
} | ||
@@ -94,0 +96,0 @@ ], |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
37019
20
831
Updated@babel/core@^7.15.8