From a82c6df25b1704670a4c98f05c11422ee878d3d1 Mon Sep 17 00:00:00 2001 From: Bjorn Lu Date: Tue, 27 Jun 2023 22:16:22 +0800 Subject: [PATCH] Remove unused rendering code (#7497) --- packages/astro/src/core/render/result.ts | 9 --------- packages/astro/src/core/render/script.ts | 8 -------- 2 files changed, 17 deletions(-) delete mode 100644 packages/astro/src/core/render/script.ts diff --git a/packages/astro/src/core/render/result.ts b/packages/astro/src/core/render/result.ts index 35155306c..27ac2ca1c 100644 --- a/packages/astro/src/core/render/result.ts +++ b/packages/astro/src/core/render/result.ts @@ -23,15 +23,6 @@ import { warn, type LogOptions } from '../logger/core.js'; const clientAddressSymbol = Symbol.for('astro.clientAddress'); const responseSentSymbol = Symbol.for('astro.responseSent'); -function onlyAvailableInSSR(name: 'Astro.redirect') { - return function _onlyAvailableInSSR() { - switch (name) { - case 'Astro.redirect': - throw new AstroError(AstroErrorData.StaticRedirectNotAvailable); - } - }; -} - export interface CreateResultArgs { adapterName: string | undefined; ssr: boolean; diff --git a/packages/astro/src/core/render/script.ts b/packages/astro/src/core/render/script.ts deleted file mode 100644 index a91391963..000000000 --- a/packages/astro/src/core/render/script.ts +++ /dev/null @@ -1,8 +0,0 @@ -export const SCRIPT_EXTENSIONS = new Set(['.js', '.ts']); - -const scriptRe = new RegExp( - `\\.(${Array.from(SCRIPT_EXTENSIONS) - .map((s) => s.slice(1)) - .join('|')})($|\\?)` -); -export const isScriptRequest = (request: string): boolean => scriptRe.test(request);