@@ -260,6 +260,116 @@ export async function getStaticPaths() {
260
260
const b = await fetch()` ,
261
261
want : `export async function getStaticPaths() {
262
262
const content = Astro.fetchContent('**/*.md');
263
+ }` ,
264
+ },
265
+ {
266
+ name : "getStaticPaths with curly brace on next line and destructured props" ,
267
+ source : `import { fn } from "package";
268
+ export async function getStaticPaths({ paginate })
269
+ {
270
+ const content = Astro.fetchContent('**/*.md');
271
+ }
272
+ const b = await fetch()` ,
273
+ want : `export async function getStaticPaths({ paginate })
274
+ {
275
+ const content = Astro.fetchContent('**/*.md');
276
+ }` ,
277
+ },
278
+ {
279
+ name : "getStaticPaths with curly brace on next line and param definition type in curly braces" ,
280
+ source : `import { fn } from "package";
281
+ export async function getStaticPaths(input: { paginate: any })
282
+ {
283
+ const content = Astro.fetchContent('**/*.md');
284
+ }
285
+ const b = await fetch()` ,
286
+ want : `export async function getStaticPaths(input: { paginate: any })
287
+ {
288
+ const content = Astro.fetchContent('**/*.md');
289
+ }` ,
290
+ },
291
+ {
292
+ name : "getStaticPaths with curly brace on next line and param definition type in square braces" ,
293
+ source : `import { fn } from "package";
294
+ export async function getStaticPaths([{ stuff }])
295
+ {
296
+ const content = Astro.fetchContent('**/*.md');
297
+ }
298
+ const b = await fetch()` ,
299
+ want : `export async function getStaticPaths([{ stuff }])
300
+ {
301
+ const content = Astro.fetchContent('**/*.md');
302
+ }` ,
303
+ },
304
+ {
305
+ name : "getStaticPaths with curly brace on next line and type specified with square braces 1" ,
306
+ source : `import { fn } from "package";
307
+ export const getStaticPaths: () => { params: any }[]
308
+ = () =>
309
+ {
310
+ const content = Astro.fetchContent('**/*.md');
311
+ }
312
+ const b = await fetch()` ,
313
+ want : `export const getStaticPaths: () => { params: any }[]
314
+ = () =>
315
+ {
316
+ const content = Astro.fetchContent('**/*.md');
317
+ }` ,
318
+ },
319
+ {
320
+ name : "getStaticPaths with curly brace on next line and type specified with square braces 2" ,
321
+ source : `import { fn } from "package";
322
+ export const getStaticPaths: () => { params: any }[] =
323
+ () =>
324
+ {
325
+ const content = Astro.fetchContent('**/*.md');
326
+ }
327
+ const b = await fetch()` ,
328
+ want : `export const getStaticPaths: () => { params: any }[] =
329
+ () =>
330
+ {
331
+ const content = Astro.fetchContent('**/*.md');
332
+ }` ,
333
+ },
334
+ {
335
+ name : "getStaticPaths with curly brace on next line and type specified with square braces 3" ,
336
+ source : `import { fn } from "package";
337
+ export const getStaticPaths: () => { params: any }[] = ()
338
+ =>
339
+ {
340
+ const content = Astro.fetchContent('**/*.md');
341
+ }
342
+ const b = await fetch()` ,
343
+ want : `export const getStaticPaths: () => { params: any }[] = ()
344
+ =>
345
+ {
346
+ const content = Astro.fetchContent('**/*.md');
347
+ }` ,
348
+ },
349
+ {
350
+ name : "getStaticPaths with curly brace on next line and type specified with square braces 4" ,
351
+ source : `import { fn } from "package";
352
+ export const getStaticPaths: () => { params: any }[] = () =>
353
+ {
354
+ const content = Astro.fetchContent('**/*.md');
355
+ }
356
+ const b = await fetch()` ,
357
+ want : `export const getStaticPaths: () => { params: any }[] = () =>
358
+ {
359
+ const content = Astro.fetchContent('**/*.md');
360
+ }` ,
361
+ },
362
+ {
363
+ name : "getStaticPaths with curly brace on next line and definition specified by anonymous function with destructured parameter" ,
364
+ source : `import { fn } from "package";
365
+ export const getStaticPaths = function({ paginate })
366
+ {
367
+ const content = Astro.fetchContent('**/*.md');
368
+ }
369
+ const b = await fetch()` ,
370
+ want : `export const getStaticPaths = function({ paginate })
371
+ {
372
+ const content = Astro.fetchContent('**/*.md');
263
373
}` ,
264
374
},
265
375
{
0 commit comments