MCPcopy
hub / github.com/nuxt/nuxt / isPublicFile

Function isPublicFile

test/basic.test.ts:2218–2228  ·  view source on GitHub ↗
(base = '/', file: string)

Source from the content-addressed store, hash-verified

2216describe.skipIf(isDev)('dynamic paths', () => {
2217 const publicFiles = ['/public.svg', '/css-only-public-asset.svg']
2218 const isPublicFile = (base = '/', file: string) => {
2219 if (isWebpack) {
2220 // TODO: webpack does not yet support dynamic static paths
2221 expect(publicFiles).toContain(file)
2222 return true
2223 }
2224
2225 expect(file).toMatch(new RegExp(`^${base.replace(/\//g, '\\/')}`))
2226 expect(publicFiles).toContain(file.replace(base, '/'))
2227 return true
2228 }
2229
2230 it('should work with no overrides', async () => {
2231 const html: string = await $fetch<string>('/assets')

Callers 1

basic.test.tsFile · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…