Comparing version 0.0.4 to 0.0.5
{ | ||
"name": "ta-dom", | ||
"version": "0.0.4", | ||
"version": "0.0.5", | ||
"main": "index.js", | ||
@@ -5,0 +5,0 @@ "description": "A tiny, simple, functional helper library for generating DOM elements. Inspired in part by the jade templating engine for node.", |
@@ -16,3 +16,2 @@ ## Ta-Dom! 🎉 ## | ||
#### Examples #### | ||
@@ -19,0 +18,0 @@ |
@@ -11,7 +11,12 @@ const TaDom = {}; | ||
if (typeof value === 'string' || typeof value === 'number') { | ||
// convert to string | ||
el.setAttribute(key, String(attributes[key])); | ||
} else if (typeof value === 'boolean') { | ||
// empty string if true, otherwise ignore | ||
if(value) { | ||
el.setAttribute(key, ''); | ||
} | ||
} else { | ||
// set as property | ||
el[key] = value; | ||
} | ||
@@ -33,6 +38,2 @@ } | ||
const eventName = key.split('on-')[1]; | ||
// const existing = listeners.get(el); | ||
// if (existing) { | ||
// existing.push({eventName, fn:attri}) | ||
// } | ||
el.addEventListener(eventName, prop); | ||
@@ -71,3 +72,3 @@ } | ||
return function(attributes, ...contents) { | ||
// make attributes argument optional | ||
// attributes argument is optional | ||
if(attributes instanceof HTMLElement || | ||
@@ -74,0 +75,0 @@ typeof attributes === 'string' || |
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
259
12987
100