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

Function removeSpecifier

packages/compiler-sfc/src/compileScript.ts:332–345  ·  view source on GitHub ↗
(i: number)

Source from the content-addressed store, hash-verified

330 // dedupe imports
331 let removed = 0
332 const removeSpecifier = (i: number) => {
333 const removeLeft = i > removed
334 removed++
335 const current = node.specifiers[i]
336 const next = node.specifiers[i + 1]
337 ctx.s.remove(
338 removeLeft
339 ? node.specifiers[i - 1].end! + startOffset
340 : current.start! + startOffset,
341 next && !removeLeft
342 ? next.start! + startOffset
343 : current.end! + startOffset,
344 )
345 }
346
347 for (let i = 0; i < node.specifiers.length; i++) {
348 const specifier = node.specifiers[i]

Callers 1

compileScriptFunction · 0.85

Calls 1

removeMethod · 0.80

Tested by

no test coverage detected