Skip to content

Commit

Permalink
Resolves issue #154: Enables field parsing even when some items may n…
Browse files Browse the repository at this point in the history
…ot include field (#155)
  • Loading branch information
rchiba authored Nov 8, 2024
1 parent c844719 commit 8332e73
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion src/assets/sitemapper.js
Original file line number Diff line number Diff line change
Expand Up @@ -331,7 +331,7 @@ export default class Sitemapper {
} else {
let fields = {};
for (const [field, active] of Object.entries(this.fields)) {
if(active){
if(active && site[field]){
fields[field] = site[field][0]
}
}
Expand Down
4 changes: 2 additions & 2 deletions src/tests/test.ts.ts
Original file line number Diff line number Diff line change
Expand Up @@ -119,9 +119,9 @@ describe('Sitemapper', function () {
});
});

it('https://www.channable.com/sitemap.xml sitemaps should contain extra fields', function (done) {
it('https://wp.seantburke.com/sitemap.xml sitemaps should contain extra fields', function (done) {
this.timeout(30000);
const url = 'https://www.channable.com/sitemap.xml';
const url = 'https://wp.seantburke.com/sitemap.xml';
sitemapper = new Sitemapper({
fields: { "loc": true,
"lastmod": true,
Expand Down

0 comments on commit 8332e73

Please sign in to comment.