diff options
author | 2025-01-10 15:13:53 +0000 | |
---|---|---|
committer | 2025-01-10 15:13:53 +0000 | |
commit | 971cfe52ae403e2fd196f1a8f0e1e87729b01dca (patch) | |
tree | a08bdf2ae4290f0388c53258c1bc844f8c5b1fb6 | |
parent | d864e0991e05438d4bdb5e14fab4f7f75efe2a1f (diff) | |
download | astro-971cfe52ae403e2fd196f1a8f0e1e87729b01dca.tar.gz astro-971cfe52ae403e2fd196f1a8f0e1e87729b01dca.tar.zst astro-971cfe52ae403e2fd196f1a8f0e1e87729b01dca.zip |
[ci] format
-rw-r--r-- | packages/astro/src/content/loaders/glob.ts | 9 | ||||
-rw-r--r-- | packages/astro/test/content-layer.test.js | 5 |
2 files changed, 9 insertions, 5 deletions
diff --git a/packages/astro/src/content/loaders/glob.ts b/packages/astro/src/content/loaders/glob.ts index 56474b00e..706fd9c0d 100644 --- a/packages/astro/src/content/loaders/glob.ts +++ b/packages/astro/src/content/loaders/glob.ts @@ -93,7 +93,12 @@ export function glob(globOptions: GlobOptions): Loader { const isLegacy = (globOptions as any)._legacy; // If global legacy collection handling flag is *not* enabled then this loader is used to emulate them instead const emulateLegacyCollections = !config.legacy.collections; - async function syncData(entry: string, base: URL, entryType?: ContentEntryType, oldId?: string) { + async function syncData( + entry: string, + base: URL, + entryType?: ContentEntryType, + oldId?: string, + ) { if (!entryType) { logger.warn(`No entry type found for ${entry}`); return; @@ -116,7 +121,7 @@ export function glob(globOptions: GlobOptions): Loader { const id = generateId({ entry, base, data }); - if(oldId && oldId !== id) { + if (oldId && oldId !== id) { store.delete(oldId); } diff --git a/packages/astro/test/content-layer.test.js b/packages/astro/test/content-layer.test.js index 10d7790ff..002c097fc 100644 --- a/packages/astro/test/content-layer.test.js +++ b/packages/astro/test/content-layer.test.js @@ -486,16 +486,15 @@ describe('Content Layer', () => { await fixture.editFile('/src/content/space/exomars.md', (prev) => { return prev.replace('rosalind-franklin-rover', 'rosalind-franklin'); - }) + }); await fixture.onNextDataStoreChange(); const updatedJsonResponse2 = await fixture.fetch('/collections.json'); const updated2 = devalue.parse(await updatedJsonResponse2.text()); assert.ok(!updated2.spacecraft.includes('rosalind-franklin-rover')); assert.ok(updated2.spacecraft.includes('rosalind-franklin')); - - await fixture.resetAllFiles(); + await fixture.resetAllFiles(); }); it('returns an error if we render an undefined entry', async () => { |