MCPcopy
hub / github.com/webpack/webpack / isBoundaryForKind

Function isBoundaryForKind

lib/html/syntax.js:4898–4909  ·  view source on GitHub ↗
(
		/** @type {HtmlElement} */ el,
		/** @type {number} */ kind
	)

Source from the content-addressed store, hash-verified

4896 const SCOPE_BUTTON = 1;
4897 const SCOPE_LIST_ITEM = 2;
4898 const isBoundaryForKind = (
4899 /** @type {HtmlElement} */ el,
4900 /** @type {number} */ kind
4901 ) => {
4902 if (isScopeBoundary(el)) return true;
4903 if (el.namespace !== NS_HTML) return false;
4904 if (kind === SCOPE_BUTTON) return el.tagName === "button";
4905 if (kind === SCOPE_LIST_ITEM) {
4906 return el.tagName === "ol" || el.tagName === "ul";
4907 }
4908 return false;
4909 };
4910 // "have an element in scope": walk the open stack from the top until the
4911 // named HTML element is found (true) or a scope boundary is hit (false).
4912 const hasNameInScope = (

Callers 1

hasNameInScopeFunction · 0.85

Calls 1

isScopeBoundaryFunction · 0.85

Tested by

no test coverage detected