(code: string, id = 'app.vue')
| 53 | }) |
| 54 | |
| 55 | function transform (code: string, id = 'app.vue') { |
| 56 | const transformerOptions = { |
| 57 | helperModule: 'unctx', |
| 58 | asyncFunctions: ['defineNuxtPlugin', 'defineNuxtRouteMiddleware'], |
| 59 | objectDefinitions: { |
| 60 | defineNuxtComponent: ['asyncData', 'setup'], |
| 61 | defineNuxtPlugin: ['setup'], |
| 62 | definePageMeta: ['middleware', 'validate'], |
| 63 | }, |
| 64 | } |
| 65 | const plugin = UnctxTransformPlugin({ sourcemap: false, transformerOptions }).raw({}, {} as any) as any |
| 66 | return plugin.transformInclude(id) ? Promise.resolve(plugin.transform.handler(code)).then((r: any) => r?.code.replace(/^ {6}/gm, '').trim()) : null |
| 67 | } |
no test coverage detected
searching dependent graphs…