Skip to content

Commit

Permalink
fix: use proper key for trailingSlash
Browse files Browse the repository at this point in the history
  • Loading branch information
harlan-zw committed Dec 13, 2022
1 parent 41cba5c commit 4793104
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 4 deletions.
3 changes: 1 addition & 2 deletions src/module.ts
Original file line number Diff line number Diff line change
Expand Up @@ -106,8 +106,7 @@ declare module 'nitropack' {
const urlFilter = createFilter(config)
const stream = new SitemapStream(config)

// @ts-expect-error untyped
const fixSlashes = (url: string) => nuxt.options.schema?.trailingSlash ? withTrailingSlash(url) : withoutTrailingSlash(url)
const fixSlashes = (url: string) => nuxt.options.sitemap?.trailingSlash ? withTrailingSlash(url) : withoutTrailingSlash(url)

const urls = sitemapRoutes
// filter for config
Expand Down
4 changes: 2 additions & 2 deletions test/generate.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -35,8 +35,8 @@ describe('generate', () => {
},
})

nuxt.options.schema = nuxt.options.schema || {}
nuxt.options.schema.trailingSlash = true
nuxt.options.sitemap = nuxt.options.sitemap || {}
nuxt.options.sitemap.trailingSlash = true

await buildNuxt(nuxt)

Expand Down

0 comments on commit 4793104

Please sign in to comment.