MCPcopy
hub / github.com/sveltejs/svelte / is_text_attribute

Function is_text_attribute

packages/svelte/src/compiler/utils/ast.js:28–34  ·  view source on GitHub ↗
(attribute)

Source from the content-addressed store, hash-verified

26 * @returns {attribute is AST.Attribute & { value: [AST.Text] }}
27 */
28export function is_text_attribute(attribute) {
29 return (
30 Array.isArray(attribute.value) &&
31 attribute.value.length === 1 &&
32 attribute.value[0].type === 'Text'
33 );
34}
35
36/**
37 * Returns true if the attribute contains a single expression node.

Callers 15

determine_slotFunction · 0.90
SlotElementFunction · 0.90
migrate_slot_usageFunction · 0.90
RegularElementFunction · 0.90
SvelteElementFunction · 0.90
BindDirectiveFunction · 0.90
is_static_elementFunction · 0.90
build_element_attributesFunction · 0.90
SlotElementFunction · 0.90
SvelteElementFunction · 0.90

Calls

no outgoing calls

Tested by

no test coverage detected