diff --git a/packages/astro/src/vite-plugin-scanner/scan.ts b/packages/astro/src/vite-plugin-scanner/scan.ts index 4af20e303085..c2bd1284b523 100644 --- a/packages/astro/src/vite-plugin-scanner/scan.ts +++ b/packages/astro/src/vite-plugin-scanner/scan.ts @@ -15,7 +15,7 @@ function includesExport(code: string) { // Support quoted values to allow statically known `import.meta.env` variables to be used function isQuoted(value: string) { - return (value[0] === '"' || value[0] === "'") && value[value.length - 1] === value[0] + return (value[0] === '"' || value[0] === "'") && value[value.length - 1] === value[0]; } function isTruthy(value: string) { diff --git a/packages/astro/test/units/vite-plugin-scanner/scan.test.js b/packages/astro/test/units/vite-plugin-scanner/scan.test.js index 373a5822b576..3bfc15960b25 100644 --- a/packages/astro/test/units/vite-plugin-scanner/scan.test.js +++ b/packages/astro/test/units/vite-plugin-scanner/scan.test.js @@ -17,7 +17,7 @@ describe('astro scan', () => { expect(result.prerender).to.equal(false); }); - it('recognizes single quoted boolean (\'true\')', async () => { + it("recognizes single quoted boolean ('true')", async () => { const result = await scan(`export const prerender = 'true';`, '/src/components/index.astro'); expect(result.prerender).to.equal(true); }); @@ -32,7 +32,7 @@ describe('astro scan', () => { expect(result.prerender).to.equal(false); }); - it('recognizes single quoted boolean (\'false\')', async () => { + it("recognizes single quoted boolean ('false')", async () => { const result = await scan(`export const prerender = 'false';`, '/src/components/index.astro'); expect(result.prerender).to.equal(false); });