Large diffs are not rendered by default.

@@ -11,7 +11,10 @@ export default function transform (raw: ParametersType): VirtualDOMPropertiesTyp
"attrs": {
...raw.attrs,
...raw.attributes,
...microformats(raw),
...microformats({
data: raw.data || {},
aria: raw.aria || {},
}),
},
"dataset": raw.dataset,
"props": {
@@ -0,0 +1,22 @@
import helper from "snabbdom/h"

import normalize from "../normalize"

import type {ParametersType} from "types"
import type {VirtualDOMNodeType} from "types"

const EMPTY_CONTENT = ""
const EMPTY_SELECTOR = ""

export default function regularElement (parameters: ParametersType): Function {
return function regularElementParameters (name: string): VirtualDOMNodeType {
const {children} = parameters
const {selector} = parameters

if (children instanceof Function) {
return helper(`${name}${selector || EMPTY_SELECTOR}`, normalize(parameters), [children])
}

return helper(`${name}${selector || EMPTY_SELECTOR}`, normalize(parameters), children || EMPTY_CONTENT)
}
}

Large diffs are not rendered by default.

@@ -0,0 +1,21 @@
import helper from "snabbdom/h"

import normalize from "../normalize"

import type {ParametersType} from "types"
import type {VirtualDOMNodeType} from "types"

const EMPTY_ERROR_MESSAGE = "Empty tags cannot semantically have children."
const EMPTY_SELECTOR = ""

export default function voidElement (parameters: ParametersType): Function {
return function voidElementParameters (name: string): VirtualDOMNodeType {
const {selector} = parameters

if (parameters && parameters.children) {
throw new Error(EMPTY_ERROR_MESSAGE)
}

return helper(`${name}${selector || EMPTY_SELECTOR}`, normalize(parameters))
}
}