Skip to content

Commit 4ebe301

Browse files
committed
chore: code style
1 parent c233f69 commit 4ebe301

File tree

2 files changed

+7
-8
lines changed

2 files changed

+7
-8
lines changed

src/module.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -227,7 +227,7 @@ async function processCollectionItems(nuxt: Nuxt, collections: ResolvedCollectio
227227
}
228228
collectionDump[collection.name] = []
229229
// Collection table definition
230-
collectionDump[collection.name].push(
230+
collectionDump[collection.name]!.push(
231231
...generateCollectionTableDefinition(collection, { drop: true }).split('\n'),
232232
)
233233

@@ -270,12 +270,12 @@ async function processCollectionItems(nuxt: Nuxt, collections: ResolvedCollectio
270270
}))
271271
}
272272
// Sort by file name to ensure consistent order
273-
list.sort((a, b) => a[0].localeCompare(String(b[0])))
274-
collectionDump[collection.name].push(...list.map(([, sql]) => sql))
273+
list.sort((a, b) => String(a[0]).localeCompare(String(b[0])))
274+
collectionDump[collection.name]!.push(...list.map(([, sql]) => sql!))
275275

276276
collectionChecksum[collection.name] = hash(collectionDump[collection.name])
277277

278-
collectionDump[collection.name].push(
278+
collectionDump[collection.name]!.push(
279279
generateCollectionTableDefinition(infoCollection, { drop: false }),
280280
`DELETE FROM ${infoCollection.tableName} WHERE _id = 'checksum_${collection.name}'`,
281281
generateCollectionInsert(infoCollection, { _id: `checksum_${collection.name}`, version: collectionChecksum[collection.name] }),

src/runtime/app.ts

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -61,13 +61,12 @@ export const useContentHead = (content: PageCollectionItemBase | null, { host, t
6161
head.link = [...(head.link || [])]
6262

6363
// Great basic informations from the content
64-
const title = head.title || content?.title
65-
if (title) {
66-
head.title = title
64+
head.title = head.title || content?.title
65+
if (head.title) {
6766
if (import.meta.server && !head.meta?.some(m => m.property === 'og:title')) {
6867
head.meta.push({
6968
property: 'og:title',
70-
content: title as string,
69+
content: head.title as string,
7170
})
7271
}
7372
}

0 commit comments

Comments
 (0)