Skip to content
Permalink

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: ekalinin/sitemap.js
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: 6.1.0
Choose a base ref
...
head repository: ekalinin/sitemap.js
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: 6.1.1
Choose a head ref
  • 3 commits
  • 8 files changed
  • 1 contributor

Commits on Mar 16, 2020

  1. add node 13 to travis

    derduher committed Mar 16, 2020

    Verified

    This commit was signed with the committer’s verified signature.
    renovate-bot Mend Renovate
    Copy the full SHA
    f997be9 View commit details

Commits on Apr 13, 2020

  1. Copy the full SHA
    86caee0 View commit details
  2. Merge pull request #287 from ekalinin/fix-createsitemapsandindex

    fixes #286. Stream closed in wrong place.
    derduher authored Apr 13, 2020
    Copy the full SHA
    00ca77a View commit details
Showing with 1,247 additions and 2,894 deletions.
  1. +1 −0 .travis.yml
  2. +4 −0 CHANGELOG.md
  3. +6 −4 lib/sitemap-index-stream.ts
  4. +2 −2 lib/sitemap-item-stream.ts
  5. +1 −1 lib/sitemap-stream.ts
  6. +1 −1 lib/utils.ts
  7. +1,215 −2,869 package-lock.json
  8. +17 −17 package.json
1 change: 1 addition & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -2,6 +2,7 @@ language: node_js
node_js:
- "10.3"
- "12"
- "13"
install:
- npm ci
script:
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
# Changelog

## 6.1.1

- Fix #286 sitemapindex tag not closing for deprecated createSitemapsAndIndex

## 6.1.0

- Added back xslUrl option removed in 5.0.0
10 changes: 6 additions & 4 deletions lib/sitemap-index-stream.ts
Original file line number Diff line number Diff line change
@@ -139,15 +139,17 @@ export async function createSitemapsAndIndex({
} else {
pipe = sms.pipe(ws);
}
chunk.forEach(smi => sms.write(smi));
chunk.forEach((smi) => sms.write(smi));
sms.end();
pipe.on('finish', () => resolve(true));
pipe.on('error', e => reject(e));
pipe.on('error', (e) => reject(e));
});
}
);
indexWS.end();
return Promise.all(smPromises).then(() => true);
return Promise.all(smPromises).then(() => {
indexStream.end();
return true;
});
}

type getSitemapStream = (i: number) => [IndexItem | string, SitemapStream];
4 changes: 2 additions & 2 deletions lib/sitemap-item-stream.ts
Original file line number Diff line number Diff line change
@@ -74,7 +74,7 @@ export class SitemapItemStream extends Transform {
}
}

item.video.forEach(video => {
item.video.forEach((video) => {
this.push(otag(TagNames['video:video']));

this.push(element(TagNames['video:thumbnail_loc'], video.thumbnail_loc));
@@ -205,7 +205,7 @@ export class SitemapItemStream extends Transform {
this.push(ctag(TagNames['video:video']));
});

item.links.forEach(link => {
item.links.forEach((link) => {
this.push(
element(TagNames['xhtml:link'], {
rel: 'alternate',
2 changes: 1 addition & 1 deletion lib/sitemap-stream.ts
Original file line number Diff line number Diff line change
@@ -100,7 +100,7 @@ export class SitemapStream extends Transform {
this.hostname = opts.hostname;
this.level = opts.level || ErrorLevel.WARN;
this.smiStream = new SitemapItemStream({ level: opts.level });
this.smiStream.on('data', data => this.push(data));
this.smiStream.on('data', (data) => this.push(data));
this.lastmodDateOnly = opts.lastmodDateOnly || false;
this.xmlNS = opts.xmlns || defaultXMLNS;
this.xslUrl = opts.xslUrl;
2 changes: 1 addition & 1 deletion lib/utils.ts
Original file line number Diff line number Diff line change
@@ -282,7 +282,7 @@ export class ReadlineStream extends Readable {
});

// Every time there's data, push it into the internal buffer.
this._source.on('line', chunk => {
this._source.on('line', (chunk) => {
// If push() returns false, then stop reading from source.
if (!this.push(chunk)) this._source.pause();
});
Loading