MCPcopy
hub / github.com/vitejs/vite / buildGlobPattern

Function buildGlobPattern

packages/vite/src/node/plugins/assetImportMetaUrl.ts:182–198  ·  view source on GitHub ↗
(ast: any)

Source from the content-addressed store, hash-verified

180}
181
182function buildGlobPattern(ast: any) {
183 let pattern = ''
184 let lastIsGlob = false
185 for (let i = 0; i < ast.quasis.length; i++) {
186 const str = ast.quasis[i].value.raw
187 if (str) {
188 pattern += str
189 lastIsGlob = false
190 }
191
192 if (ast.expressions[i] && !lastIsGlob) {
193 pattern += '*'
194 lastIsGlob = true
195 }
196 }
197 return pattern
198}
199
200function getQueryDelimiterIndex(rawUrl: string): number {
201 let bracketsStack = 0

Callers 1

handlerFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected