0
Fork 0
mirror of https://github.com/withastro/astro.git synced 2024-12-16 21:46:22 -05:00

[ci] format

This commit is contained in:
matthewp 2022-08-12 16:21:28 +00:00 committed by fredkbot
parent 8f845ca950
commit 62763d50b5
8 changed files with 21 additions and 14 deletions

View file

@ -30,7 +30,7 @@ export function getRouteGenerator(
// Unless trailingSlash config is set to 'always', don't automatically append it.
let trailing: '/' | '' = '';
if(addTrailingSlash === 'always' && segments.length) {
if (addTrailingSlash === 'always' && segments.length) {
trailing = '/';
}
const toPath = compile(template + trailing);

View file

@ -1,5 +1,5 @@
/* eslint-disable no-console */
import { SSRResult, SSRRenderInstruction } from '../../@types/astro.js';
import { SSRRenderInstruction, SSRResult } from '../../@types/astro.js';
import { AstroJSX, isVNode } from '../../jsx-runtime/index.js';
import {
escapeHTML,

View file

@ -1,7 +1,6 @@
import { SSRRenderInstruction, SSRResult } from '../../../@types/astro';
import { escapeHTML, HTMLString, markHTMLString } from '../escape.js';
import { AstroComponent, renderAstroComponent } from './astro.js';
import { stringifyChunk } from './common.js';
export async function* renderChild(child: any): AsyncIterable<any> {
child = await child;
@ -35,7 +34,11 @@ export async function* renderChild(child: any): AsyncIterable<any> {
}
}
export async function renderSlot(result: SSRResult, slotted: string, fallback?: any): Promise<string> {
export async function renderSlot(
result: SSRResult,
slotted: string,
fallback?: any
): Promise<string> {
if (slotted) {
let iterator = renderChild(slotted);
let content = '';

View file

@ -1,4 +1,4 @@
import type { SSRResult, SSRRenderInstruction } from '../../../@types/astro';
import type { SSRRenderInstruction, SSRResult } from '../../../@types/astro';
import type { AstroComponentFactory } from './index';
import { markHTMLString } from '../escape.js';

View file

@ -1,4 +1,4 @@
import type { SSRResult, SSRRenderInstruction } from '../../../@types/astro';
import type { SSRRenderInstruction, SSRResult } from '../../../@types/astro';
import { markHTMLString } from '../escape.js';
import {

View file

@ -1,5 +1,9 @@
import type { AstroComponentMetadata, SSRLoadedRenderer, SSRResult, SSRRenderInstruction } from '../../../@types/astro';
import type {
AstroComponentMetadata,
SSRLoadedRenderer,
SSRRenderInstruction,
SSRResult,
} from '../../../@types/astro';
import { markHTMLString } from '../escape.js';
import { extractDirectives, generateHydrateScript } from '../hydration.js';

View file

@ -52,10 +52,10 @@ export async function renderPage(
// Combines HTML chunks coming from the iterable with rendering instructions
// added to metadata. These instructions need to go out first to ensure
// the scripts exist before the islands that need them.
async function * eachChunk() {
async function* eachChunk() {
for await (const chunk of iterable) {
if(result._metadata.pendingInstructions.size) {
for(const instr of result._metadata.pendingInstructions) {
if (result._metadata.pendingInstructions.size) {
for (const instr of result._metadata.pendingInstructions) {
result._metadata.pendingInstructions.delete(instr);
yield instr;
}

View file

@ -41,10 +41,10 @@ describe('Hydration script ordering', async () => {
let foundScript = false;
// Traverse the DOM going backwards until we find a script, if there is one.
while(el.length) {
while (el.length) {
let last = el;
while(el.length) {
if(el.prop('tagName') === 'SCRIPT') {
while (el.length) {
if (el.prop('tagName') === 'SCRIPT') {
foundScript = true;
}
last = el;