MCPcopy
hub / github.com/vuejs/core / findDir

Function findDir

packages/compiler-core/src/utils.ts:283–298  ·  view source on GitHub ↗
(
  node: ElementNode,
  name: string | RegExp,
  allowEmpty: boolean = false,
)

Source from the content-addressed store, hash-verified

281}
282
283export function findDir(
284 node: ElementNode,
285 name: string | RegExp,
286 allowEmpty: boolean = false,
287): DirectiveNode | undefined {
288 for (let i = 0; i < node.props.length; i++) {
289 const p = node.props[i]
290 if (
291 p.type === NodeTypes.DIRECTIVE &&
292 (allowEmpty || p.exp) &&
293 (isString(name) ? p.name === name : name.test(p.name))
294 ) {
295 return p
296 }
297 }
298}
299
300export function findProp(
301 node: ElementNode,

Callers 15

checkDuplicatedValueFunction · 0.90
analyzeNodeFunction · 0.90
createIfBranchFunction · 0.90
transformOnceFunction · 0.90
transformMemoFunction · 0.90
trackSlotScopesFunction · 0.90
trackVForSlotScopesFunction · 0.90
buildSlotsFunction · 0.90
walkFunction · 0.90
vFor.tsFile · 0.90
transformExpressionFunction · 0.90
injectCssVarsFunction · 0.85

Calls 2

isStringFunction · 0.90
testMethod · 0.80

Tested by

no test coverage detected