Skip to content

Commit 5f0f6ec

Browse files
committed
maint(docs): Add improve JSDoc strings a bit.
1 parent 504e342 commit 5f0f6ec

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

src/core/dom.js

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -131,8 +131,14 @@ const is_visible = (el) => {
131131
return el.offsetWidth > 0 && el.offsetHeight > 0;
132132
};
133133

134+
/**
135+
* Return a DocumentFragment from a given string.
136+
*
137+
* @param {String} string - The HTML structure as a string.
138+
*
139+
* @returns {DocumentFragment} - The DOM nodes as a DocumentFragment.
140+
*/
134141
const create_from_string = (string) => {
135-
// Create a DOM nodes from a string.
136142
// See: https://davidwalsh.name/convert-html-stings-dom-nodes
137143
return document.createRange().createContextualFragment(string.trim());
138144
};

0 commit comments

Comments
 (0)