0
Fork 0
mirror of https://github.com/withastro/astro.git synced 2025-03-24 23:21:57 -05:00

[ci] format

This commit is contained in:
Emanuele Stoppa 2024-08-13 10:21:00 +00:00 committed by astrobot-houston
parent 34da907f3b
commit 242be51618

View file

@ -65,7 +65,13 @@ export async function scan(
.trim();
// For a given export, check the value of the first non-whitespace token.
// Basically extract the `true` from the statement `export const prerender = true`
const suffix = code.slice(endOfLocalName).trim().replace(/=/, '').trim().split(/[;\n\r]/)[0].trim();
const suffix = code
.slice(endOfLocalName)
.trim()
.replace(/=/, '')
.trim()
.split(/[;\n\r]/)[0]
.trim();
if (prefix !== 'const' || !(isTruthy(suffix) || isFalsy(suffix))) {
throw new AstroError({
...AstroErrorData.InvalidPrerenderExport,