0
Fork 0
mirror of https://github.com/withastro/astro.git synced 2025-03-10 23:01:26 -05:00

nit: use node: prefix everywhere (#7692)

* nit: use `node:` prefix everywhere

* nit: fs/promises too

* test: workaround issue in node builtin detection
This commit is contained in:
Erika 2023-07-18 02:17:59 +02:00 committed by GitHub
parent 0d92624942
commit a1a8491832
2 changed files with 4 additions and 4 deletions

View file

@ -3,7 +3,7 @@ import type { AstroAdapter, AstroConfig, AstroIntegration, RouteData } from 'ast
import glob from 'fast-glob';
import { basename } from 'node:path';
import { fileURLToPath } from 'node:url';
import { pathToFileURL } from 'url';
import { pathToFileURL } from 'node:url';
import {
defaultImageConfig,
getImageConfig,

View file

@ -1,4 +1,4 @@
import { existsSync } from 'fs';
import { existsSync } from 'node:fs';
import { join } from 'node:path';
import { fileURLToPath, pathToFileURL } from 'node:url';
import { ASTRO_LOCALS_HEADER } from './adapter.js';
@ -62,12 +62,12 @@ import { onRequest } from ${middlewarePath};
import { createContext, trySerializeLocals } from 'astro/middleware';
export default async function middleware(request, context) {
const url = new URL(request.url);
const ctx = createContext({
const ctx = createContext({
request,
params: {}
});
ctx.locals = ${handlerTemplateCall};
const next = async () => {
const next = async () => {
const response = await fetch(url, {
headers: {
${JSON.stringify(ASTRO_LOCALS_HEADER)}: trySerializeLocals(ctx.locals)