Comparing version 2.0.1 to 2.0.2
{ | ||
"name": "araz", | ||
"version": "2.0.1", | ||
"version": "2.0.2", | ||
"description": "", | ||
@@ -5,0 +5,0 @@ "main": "index.ts", |
import { Mount } from "./types"; | ||
export const mount = ({$node, $target}: Mount): HTMLElement => { | ||
$target.replaceWith($node); | ||
$target.append($node); | ||
return $node; | ||
}; |
@@ -9,2 +9,3 @@ import { | ||
join, | ||
kebabCase, | ||
map, | ||
@@ -22,7 +23,10 @@ } from "lodash-es"; | ||
for await (const [key, value] of entries($attrs)) { | ||
if (isEqual(key,"style") && isObject(value)) { | ||
const result = map(entries(value),([property, propertyValue]) => `${property}:${propertyValue}`); | ||
const result = map(entries(value),([property, propertyValue]) => `${kebabCase(property)}:${propertyValue}`); | ||
const styleString = join(result, ";"); | ||
$el.setAttribute("style", styleString); | ||
} else if (isEqual(key,"events") && isObject(value)) { | ||
} | ||
else if (isEqual(key,"events") && isObject(value)) { | ||
for (const [eventName, eventHandler] of entries(value)) { | ||
@@ -37,5 +41,8 @@ const formattedEventName = camelCase(eventName.slice(2)); | ||
} | ||
} else { | ||
} | ||
else { | ||
$el.setAttribute(key, isString(value) ? value.toString() : ""); | ||
} | ||
} | ||
@@ -42,0 +49,0 @@ |
@@ -34,3 +34,3 @@ export type HTMLTags = 'a' | 'abbr' | 'address' | 'area' | 'article' | 'aside' | 'audio' | 'b' | | ||
$attrs?: Attrs; | ||
$children?: (VNode | string)[]; | ||
} | ||
$children?: any; | ||
} |
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
8879
185