MCPcopy Create free account
hub / github.com/cyclejs/cyclejs / createTagFunction

Function createTagFunction

dom/src/hyperscript-helpers.ts:12–30  ·  view source on GitHub ↗
(tagName: string)

Source from the content-addressed store, hash-verified

10}
11
12function createTagFunction(tagName: string): Function {
13 return function hyperscript(first: any, b?: any, c?: any): VNode {
14 if (isSelector(first)) {
15 if (typeof b !== 'undefined' && typeof c !== 'undefined') {
16 return h(tagName + first, b, c);
17 } else if (typeof b !== 'undefined') {
18 return h(tagName + first, b);
19 } else {
20 return h(tagName + first, {});
21 }
22 } else if (!!b) {
23 return h(tagName, first, b);
24 } else if (!!first) {
25 return h(tagName, first);
26 } else {
27 return h(tagName, {});
28 }
29 };
30}
31
32const SVG_TAG_NAMES = [
33 'a', 'altGlyph', 'altGlyphDef', 'altGlyphItem', 'animate', 'animateColor',

Callers 1

Calls 1

isSelectorFunction · 0.85

Tested by

no test coverage detected