Comparing version 2.0.3 to 2.0.4
{ | ||
"name": "araz", | ||
"version": "2.0.3", | ||
"version": "2.0.4", | ||
"description": "", | ||
@@ -5,0 +5,0 @@ "main": "index.ts", |
import { | ||
camelCase, | ||
entries, | ||
isArray, | ||
isEqual, | ||
@@ -11,6 +12,7 @@ isFunction, | ||
map, | ||
trim | ||
} from "lodash-es"; | ||
import { VNode } from "./types"; | ||
export const createNode = async ({ | ||
export const render = async ({ | ||
$tag, | ||
@@ -23,10 +25,10 @@ $attrs = {}, | ||
for await (const [key, value] of entries($attrs)) { | ||
if (isEqual(key,"style") && isObject(value)) { | ||
const result = map(entries(value),([property, propertyValue]) => `${kebabCase(property)}:${propertyValue}`); | ||
if (isEqual(key, "style") && isObject(value)) { | ||
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)) { | ||
@@ -41,3 +43,3 @@ const formattedEventName = camelCase(eventName.slice(2)); | ||
} | ||
} | ||
} | ||
@@ -54,3 +56,3 @@ else { | ||
} else { | ||
const $child = await createNode(child); | ||
const $child = await render(child); | ||
$el.appendChild($child); | ||
@@ -61,7 +63,2 @@ } | ||
return $el; | ||
}; | ||
export const render = (vNode: VNode): Promise<HTMLElement> => { | ||
const $el = createNode(vNode); | ||
return $el; | ||
}; | ||
}; |
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
8767
182