Skip to content

Commit d1d0523

Browse files
committed
📝 Add some jsDocs to getElementType function
I always forget what this ElementType refers too, no more.
1 parent 051dfd8 commit d1d0523

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

Diff for: src/utils/getElementType.ts

+7
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,13 @@ import type { AST } from "vue-eslint-parser";
33
import getElementAttributeValue from "./getElementAttributeValue";
44
import makeKebabCase from "./makeKebabCase";
55

6+
/**
7+
* Returns a kebab-normalized string representing the element node name
8+
* or, if the `is` attribute is a string, its value if present.
9+
* @example <div is="foo-bar"> => "foo-bar"
10+
* @example <foo-bar> => "foo-bar"
11+
* @example <div> => "div"
12+
*/
613
function getElementType(node: AST.VElement) {
714
let is = getElementAttributeValue(node, "is");
815

0 commit comments

Comments
 (0)