edge-sitemap
Advanced tools
Comparing version 1.0.4 to 1.0.5
/** | ||
* @typedef {('always'|'daily'|'hourly'|'monthly'|'never'|'weekly'|'yearly')} SitemapChangeFreq | ||
* @typedef {'always' | 'daily' | 'hourly' | 'monthly' | 'never' | 'weekly' | 'yearly'} SitemapChangeFreq | ||
*/ | ||
@@ -7,6 +7,6 @@ | ||
* @typedef {Object} SitemapItem | ||
* @property {SitemapChangeFreq=} changefreq | ||
* @property {`${number}-${number}-${number}`=} lastmod | ||
* @property {SitemapChangeFreq} [changefreq] | ||
* @property {`${number}-${number}-${number}`} [lastmod] | ||
* @property {(URL|string)} loc | ||
* @property {number=} priority | ||
* @property {number} [priority] | ||
*/ | ||
@@ -16,4 +16,4 @@ | ||
* @typedef {Object} SitemapTransformerOptions | ||
* @property {(URL|string)=} baseURL | ||
* @property {boolean=} pretty | ||
* @property {URL | string} [baseURL] | ||
* @property {boolean} [pretty] | ||
*/ | ||
@@ -25,3 +25,3 @@ | ||
export class SitemapTransformer { | ||
/** @type {(URL|string)=} */ | ||
/** @type {URL | string | undefined} */ | ||
#baseURL | ||
@@ -34,3 +34,3 @@ /** @type {string} */ | ||
/** | ||
* @param {SitemapTransformerOptions=} options | ||
* @param {SitemapTransformerOptions} [options] | ||
*/ | ||
@@ -109,12 +109,15 @@ constructor( | ||
* @typedef {Object} SitemapStreamOptions | ||
* @property {(URL|string)=} baseURL | ||
* @property {boolean=} pretty | ||
* @property {URL | string} [baseURL] | ||
* @property {boolean} [pretty] | ||
*/ | ||
/** | ||
* @extends {TransformStream<SitemapItem, string>} | ||
* @implements {TransformStream<SitemapItem, string>} | ||
*/ | ||
export class SitemapStream extends TransformStream { | ||
export class SitemapStream { | ||
/** @type {TransformStream<SitemapItem, string>} */ | ||
#transformStream | ||
/** | ||
* @param {SitemapStreamOptions=} options | ||
* @param {SitemapStreamOptions} [options] | ||
*/ | ||
@@ -127,4 +130,20 @@ constructor( | ||
) { | ||
super(new SitemapTransformer({ baseURL, pretty })) | ||
this.#transformStream = new TransformStream( | ||
new SitemapTransformer({ baseURL, pretty }) | ||
) | ||
} | ||
/** | ||
* @returns {ReadableStream<string>} | ||
*/ | ||
get readable() { | ||
return this.#transformStream.readable | ||
} | ||
/** | ||
* @returns {WritableStream<SitemapItem>} | ||
*/ | ||
get writable() { | ||
return this.#transformStream.writable | ||
} | ||
} |
@@ -42,3 +42,3 @@ { | ||
"types": "./src/index.d.ts", | ||
"version": "1.0.4", | ||
"version": "1.0.5", | ||
"scripts": { | ||
@@ -45,0 +45,0 @@ "build": "tsc", |
/** | ||
* @typedef {('always'|'daily'|'hourly'|'monthly'|'never'|'weekly'|'yearly')} SitemapChangeFreq | ||
* @typedef {'always' | 'daily' | 'hourly' | 'monthly' | 'never' | 'weekly' | 'yearly'} SitemapChangeFreq | ||
*/ | ||
/** | ||
* @typedef {Object} SitemapItem | ||
* @property {SitemapChangeFreq=} changefreq | ||
* @property {`${number}-${number}-${number}`=} lastmod | ||
* @property {SitemapChangeFreq} [changefreq] | ||
* @property {`${number}-${number}-${number}`} [lastmod] | ||
* @property {(URL|string)} loc | ||
* @property {number=} priority | ||
* @property {number} [priority] | ||
*/ | ||
/** | ||
* @typedef {Object} SitemapTransformerOptions | ||
* @property {(URL|string)=} baseURL | ||
* @property {boolean=} pretty | ||
* @property {URL | string} [baseURL] | ||
* @property {boolean} [pretty] | ||
*/ | ||
@@ -21,3 +21,3 @@ /** | ||
/** | ||
* @param {SitemapTransformerOptions=} options | ||
* @param {SitemapTransformerOptions} [options] | ||
*/ | ||
@@ -32,15 +32,24 @@ constructor({ baseURL, pretty }?: SitemapTransformerOptions | undefined); | ||
* @typedef {Object} SitemapStreamOptions | ||
* @property {(URL|string)=} baseURL | ||
* @property {boolean=} pretty | ||
* @property {URL | string} [baseURL] | ||
* @property {boolean} [pretty] | ||
*/ | ||
/** | ||
* @extends {TransformStream<SitemapItem, string>} | ||
* @implements {TransformStream<SitemapItem, string>} | ||
*/ | ||
export class SitemapStream extends TransformStream<SitemapItem, string> { | ||
export class SitemapStream implements TransformStream<SitemapItem, string> { | ||
/** | ||
* @param {SitemapStreamOptions=} options | ||
* @param {SitemapStreamOptions} [options] | ||
*/ | ||
constructor({ baseURL, pretty }?: SitemapStreamOptions | undefined); | ||
/** | ||
* @returns {ReadableStream<string>} | ||
*/ | ||
get readable(): ReadableStream<string>; | ||
/** | ||
* @returns {WritableStream<SitemapItem>} | ||
*/ | ||
get writable(): WritableStream<SitemapItem>; | ||
#private; | ||
} | ||
export type SitemapChangeFreq = ('always' | 'daily' | 'hourly' | 'monthly' | 'never' | 'weekly' | 'yearly'); | ||
export type SitemapChangeFreq = 'always' | 'daily' | 'hourly' | 'monthly' | 'never' | 'weekly' | 'yearly'; | ||
export type SitemapItem = { | ||
@@ -53,8 +62,8 @@ changefreq?: SitemapChangeFreq | undefined; | ||
export type SitemapTransformerOptions = { | ||
baseURL?: (URL | string) | undefined; | ||
baseURL?: string | URL | undefined; | ||
pretty?: boolean | undefined; | ||
}; | ||
export type SitemapStreamOptions = { | ||
baseURL?: (URL | string) | undefined; | ||
baseURL?: string | URL | undefined; | ||
pretty?: boolean | undefined; | ||
}; |
/** | ||
* @typedef {('always'|'daily'|'hourly'|'monthly'|'never'|'weekly'|'yearly')} SitemapChangeFreq | ||
* @typedef {'always' | 'daily' | 'hourly' | 'monthly' | 'never' | 'weekly' | 'yearly'} SitemapChangeFreq | ||
*/ | ||
@@ -7,6 +7,6 @@ | ||
* @typedef {Object} SitemapItem | ||
* @property {SitemapChangeFreq=} changefreq | ||
* @property {`${number}-${number}-${number}`=} lastmod | ||
* @property {SitemapChangeFreq} [changefreq] | ||
* @property {`${number}-${number}-${number}`} [lastmod] | ||
* @property {(URL|string)} loc | ||
* @property {number=} priority | ||
* @property {number} [priority] | ||
*/ | ||
@@ -16,4 +16,4 @@ | ||
* @typedef {Object} SitemapTransformerOptions | ||
* @property {(URL|string)=} baseURL | ||
* @property {boolean=} pretty | ||
* @property {URL | string} [baseURL] | ||
* @property {boolean} [pretty] | ||
*/ | ||
@@ -25,3 +25,3 @@ | ||
export class SitemapTransformer { | ||
/** @type {(URL|string)=} */ | ||
/** @type {URL | string | undefined} */ | ||
#baseURL | ||
@@ -34,3 +34,3 @@ /** @type {string} */ | ||
/** | ||
* @param {SitemapTransformerOptions=} options | ||
* @param {SitemapTransformerOptions} [options] | ||
*/ | ||
@@ -109,12 +109,15 @@ constructor( | ||
* @typedef {Object} SitemapStreamOptions | ||
* @property {(URL|string)=} baseURL | ||
* @property {boolean=} pretty | ||
* @property {URL | string} [baseURL] | ||
* @property {boolean} [pretty] | ||
*/ | ||
/** | ||
* @extends {TransformStream<SitemapItem, string>} | ||
* @implements {TransformStream<SitemapItem, string>} | ||
*/ | ||
export class SitemapStream extends TransformStream { | ||
export class SitemapStream { | ||
/** @type {TransformStream<SitemapItem, string>} */ | ||
#transformStream | ||
/** | ||
* @param {SitemapStreamOptions=} options | ||
* @param {SitemapStreamOptions} [options] | ||
*/ | ||
@@ -127,4 +130,20 @@ constructor( | ||
) { | ||
super(new SitemapTransformer({ baseURL, pretty })) | ||
this.#transformStream = new TransformStream( | ||
new SitemapTransformer({ baseURL, pretty }) | ||
) | ||
} | ||
/** | ||
* @returns {ReadableStream<string>} | ||
*/ | ||
get readable() { | ||
return this.#transformStream.readable | ||
} | ||
/** | ||
* @returns {WritableStream<SitemapItem>} | ||
*/ | ||
get writable() { | ||
return this.#transformStream.writable | ||
} | ||
} |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
Major refactor
Supply chain riskPackage has recently undergone a major refactor. It may be unstable or indicate significant internal changes. Use caution when updating to versions that include significant changes.
Found 1 instance in 1 package
12039
312
0