mirror of
https://github.com/withastro/astro.git
synced 2025-03-31 23:31:30 -05:00
[ci] format
This commit is contained in:
parent
440681e7b7
commit
3807e3e868
7 changed files with 23 additions and 23 deletions
|
@ -7,11 +7,11 @@ import type {
|
|||
ValidRedirectStatus,
|
||||
} from '../@types/astro.js';
|
||||
import { shouldAppendForwardSlash } from '../core/build/util.js';
|
||||
import { REROUTE_DIRECTIVE_HEADER } from '../core/constants.js';
|
||||
import { MissingLocale } from '../core/errors/errors-data.js';
|
||||
import { AstroError } from '../core/errors/index.js';
|
||||
import type { RoutingStrategies } from './utils.js';
|
||||
import { createI18nMiddleware } from './middleware.js';
|
||||
import { REROUTE_DIRECTIVE_HEADER } from '../core/constants.js';
|
||||
import type { RoutingStrategies } from './utils.js';
|
||||
|
||||
export function requestHasLocale(locales: Locales) {
|
||||
return function (context: APIContext): boolean {
|
||||
|
|
|
@ -1,15 +1,15 @@
|
|||
import {
|
||||
getPathByLocale,
|
||||
type MiddlewarePayload,
|
||||
notFound,
|
||||
normalizeTheLocale,
|
||||
requestHasLocale,
|
||||
redirectToDefaultLocale,
|
||||
redirectToFallback,
|
||||
} from './index.js';
|
||||
import type { APIContext, MiddlewareHandler, SSRManifest } from '../@types/astro.js';
|
||||
import type { SSRManifestI18n } from '../core/app/types.js';
|
||||
import { ROUTE_TYPE_HEADER } from '../core/constants.js';
|
||||
import {
|
||||
type MiddlewarePayload,
|
||||
getPathByLocale,
|
||||
normalizeTheLocale,
|
||||
notFound,
|
||||
redirectToDefaultLocale,
|
||||
redirectToFallback,
|
||||
requestHasLocale,
|
||||
} from './index.js';
|
||||
|
||||
export function createI18nMiddleware(
|
||||
i18n: SSRManifest['i18n'],
|
||||
|
|
|
@ -1,15 +1,15 @@
|
|||
import * as I18nInternals from '../i18n/index.js';
|
||||
import { toRoutingStrategy } from '../i18n/utils.js';
|
||||
import { AstroError } from '../core/errors/index.js';
|
||||
import { IncorrectStrategyForI18n } from '../core/errors/errors-data.js';
|
||||
import type { RedirectToFallback } from '../i18n/index.js';
|
||||
import type { SSRManifest } from '../core/app/types.js';
|
||||
import type {
|
||||
APIContext,
|
||||
AstroConfig,
|
||||
MiddlewareHandler,
|
||||
ValidRedirectStatus,
|
||||
} from '../@types/astro.js';
|
||||
import type { SSRManifest } from '../core/app/types.js';
|
||||
import { IncorrectStrategyForI18n } from '../core/errors/errors-data.js';
|
||||
import { AstroError } from '../core/errors/index.js';
|
||||
import * as I18nInternals from '../i18n/index.js';
|
||||
import type { RedirectToFallback } from '../i18n/index.js';
|
||||
import { toRoutingStrategy } from '../i18n/utils.js';
|
||||
import type { I18nInternalConfig } from '../i18n/vite-plugin-i18n.js';
|
||||
export { normalizeTheLocale, toCodes, toPaths } from '../i18n/index.js';
|
||||
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
import { defineMiddleware, sequence } from 'astro:middleware';
|
||||
import { middleware } from 'astro:i18n';
|
||||
import { defineMiddleware, sequence } from 'astro:middleware';
|
||||
|
||||
const customLogic = defineMiddleware(async (context, next) => {
|
||||
const url = new URL(context.request.url);
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
import { defineMiddleware } from 'astro:middleware';
|
||||
import { redirectToDefaultLocale, requestHasLocale } from 'astro:i18n';
|
||||
import { defineMiddleware } from 'astro:middleware';
|
||||
|
||||
const allowList = new Set(['/help', '/help/']);
|
||||
|
||||
|
|
|
@ -1,8 +1,8 @@
|
|||
import { describe, it, before, after } from 'node:test';
|
||||
import assert from 'node:assert/strict';
|
||||
import { loadFixture } from './test-utils.js';
|
||||
import { after, before, describe, it } from 'node:test';
|
||||
import * as cheerio from 'cheerio';
|
||||
import testAdapter from './test-adapter.js';
|
||||
import { loadFixture } from './test-utils.js';
|
||||
|
||||
// DEV
|
||||
describe('Dev server manual routing', () => {
|
||||
|
|
|
@ -1,8 +1,8 @@
|
|||
import { describe, it, before, after } from 'node:test';
|
||||
import assert from 'node:assert/strict';
|
||||
import { loadFixture } from './test-utils.js';
|
||||
import { after, before, describe, it } from 'node:test';
|
||||
import * as cheerio from 'cheerio';
|
||||
import testAdapter from './test-adapter.js';
|
||||
import { loadFixture } from './test-utils.js';
|
||||
|
||||
// DEV
|
||||
describe('Dev server manual routing', () => {
|
||||
|
|
Loading…
Add table
Reference in a new issue