New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

@storefront-x/sitemap

Package Overview
Dependencies
Maintainers
1
Versions
72
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@storefront-x/sitemap - npm Package Compare versions

Comparing version 1.17.0 to 1.18.0

4

package.json
{
"name": "@storefront-x/sitemap",
"version": "1.17.0",
"version": "1.18.0",
"license": "MIT",

@@ -9,3 +9,3 @@ "type": "module",

},
"gitHead": "d15cfd1364da407837b960a8ffe7711710f4cb5e"
"gitHead": "0bb143c298482c7cab0bd333a8be5d3f76d6b45a"
}

@@ -1,11 +0,15 @@

import { Request, Response } from 'express'
import { eventHandler, getRequestURL, setResponseHeader } from 'h3'
import sitemap from '@storefront-x/sitemap/sitemap.js'
export default async (req: Request, res: Response) => {
export default eventHandler(async (event) => {
const requestUrl = getRequestURL(event)
const finalSitemap = await sitemap({
path: req.baseUrl,
host: req.hostname,
path: requestUrl.pathname,
host: requestUrl.hostname,
})
res.type('text/xml').end(finalSitemap)
}
setResponseHeader(event, 'Content-Type', 'text/xml')
return finalSitemap
})

@@ -1,11 +0,15 @@

import { Request, Response } from 'express'
import { eventHandler, getRequestURL, setResponseHeader } from 'h3'
import sitemap from '@storefront-x/sitemap/sitemap.js'
export default async (req: Request, res: Response) => {
export default eventHandler(async (event) => {
const requestUrl = getRequestURL(event)
const finalSitemap = await sitemap({
path: req.baseUrl,
host: req.hostname,
path: requestUrl.pathname,
host: requestUrl.hostname,
})
res.type('text/xml').end(finalSitemap)
}
setResponseHeader(event, 'Content-Type', 'text/xml')
return finalSitemap
})

@@ -42,6 +42,6 @@ import { test, expect } from '@playwright/test'

async ({ url }) => {
await page.goto(url + '/sitemap.xml', { waitUntil: 'networkidle' })
await expect(await page.content()).toContain('https://localhost/sign-in')
await page.goto(url + '/cz/sitemap.xml', { waitUntil: 'networkidle' })
await expect(await page.content()).toContain('https://localhost/cz/sign-in')
const response1 = await page.goto(url + '/sitemap.xml')
await expect(await response1.text()).toContain('/sign-in')
const response2 = await page.goto(url + '/cz/sitemap.xml')
await expect(await response2.text()).toContain('/cz/sign-in')
},

@@ -95,8 +95,8 @@ )

async ({ url }) => {
await page.goto(url + '/sitemap.xml', { waitUntil: 'networkidle' })
await expect(await page.content()).toContain('https://localhost/sign-in')
await page.goto(url + '/cz/sitemap.xml', { waitUntil: 'networkidle' })
await expect(await page.content()).toContain('https://localhost/cz/prihlasit')
const response1 = await page.goto(url + '/sitemap.xml')
await expect(await response1.text()).toContain('/sign-in')
const response2 = await page.goto(url + '/cz/sitemap.xml')
await expect(await response2.text()).toContain('/cz/prihlasit')
},
)
})
SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc