Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

edge-sitemap

Package Overview
Dependencies
Maintainers
1
Versions
6
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

edge-sitemap - npm Package Compare versions

Comparing version 1.0.6 to 1.1.1

14

./src/index.js

@@ -44,2 +44,9 @@ /**

/**
* @returns {string}
*/
get [Symbol.toStringTag]() {
return 'SitemapTransformer'
}
/** @type {TransformerFlushCallback<string>} */

@@ -132,2 +139,9 @@ flush(controller) {

/**
* @returns {string}
*/
get [Symbol.toStringTag]() {
return 'SitemapStream'
}
/**
* @returns {ReadableStream<string>}

@@ -134,0 +148,0 @@ */

2

package.json

@@ -42,3 +42,3 @@ {

"types": "./src/index.d.ts",
"version": "1.0.6",
"version": "1.1.1",
"scripts": {

@@ -45,0 +45,0 @@ "build": "tsc",

@@ -10,24 +10,23 @@ # Edge Sitemap

async function writeSitemap(writer) {
await writer.ready
await Promise.all([
writer.write({
loc: '/',
priority: 1.0,
}),
writer.write({
loc: '/privacy',
priority: 0.1,
}),
])
await writer.close()
function createReadableStream() {
return new ReadableStream({
start(controller) {
controller.enqueue({
loc: '/',
priority: 1.0,
})
controller.enqueue({
loc: '/privacy',
priority: 0.1,
})
controller.close()
},
})
}
addEventListener('fetch', (event) => {
const { readable: smReadable, writable: smWritable } = new Sitemap({
baseURL: 'https://example.com/',
})
const body = smReadable.pipeThrough(new TextEncoderStream())
const baseURL = 'https://example.com/'
const body = createReadableStream()
.pipeThrough(new SitemapStream({ baseURL }))
.pipeThrough(new TextEncoderStream())
const response = new Response(body, {

@@ -39,6 +38,4 @@ headers: {

writeSitemap(smWritable.getWriter())
return event.respondWith(response)
})
```

@@ -27,2 +27,6 @@ /**

transform(chunk: SitemapItem, controller: TransformStreamDefaultController<string>): void | PromiseLike<void>;
/**
* @returns {string}
*/
get [Symbol.toStringTag](): string;
#private;

@@ -51,2 +55,6 @@ }

get writable(): WritableStream<SitemapItem>;
/**
* @returns {string}
*/
get [Symbol.toStringTag](): string;
#private;

@@ -53,0 +61,0 @@ }

@@ -44,2 +44,9 @@ /**

/**
* @returns {string}
*/
get [Symbol.toStringTag]() {
return 'SitemapTransformer'
}
/** @type {TransformerFlushCallback<string>} */

@@ -132,2 +139,9 @@ flush(controller) {

/**
* @returns {string}
*/
get [Symbol.toStringTag]() {
return 'SitemapStream'
}
/**
* @returns {ReadableStream<string>}

@@ -134,0 +148,0 @@ */

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