Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

ta-dom

Package Overview
Dependencies
Maintainers
1
Versions
4
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

ta-dom - npm Package Compare versions

Comparing version 0.0.4 to 0.0.5

2

package.json
{
"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' ||

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