Skip to content

Commit 8332e73

Browse files
authored
Resolves issue #154: Enables field parsing even when some items may not include field (#155)
1 parent c844719 commit 8332e73

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

Diff for: src/assets/sitemapper.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -331,7 +331,7 @@ export default class Sitemapper {
331331
} else {
332332
let fields = {};
333333
for (const [field, active] of Object.entries(this.fields)) {
334-
if(active){
334+
if(active && site[field]){
335335
fields[field] = site[field][0]
336336
}
337337
}

Diff for: src/tests/test.ts.ts

+2-2
Original file line numberDiff line numberDiff line change
@@ -119,9 +119,9 @@ describe('Sitemapper', function () {
119119
});
120120
});
121121

122-
it('https://www.channable.com/sitemap.xml sitemaps should contain extra fields', function (done) {
122+
it('https://wp.seantburke.com/sitemap.xml sitemaps should contain extra fields', function (done) {
123123
this.timeout(30000);
124-
const url = 'https://www.channable.com/sitemap.xml';
124+
const url = 'https://wp.seantburke.com/sitemap.xml';
125125
sitemapper = new Sitemapper({
126126
fields: { "loc": true,
127127
"lastmod": true,

0 commit comments

Comments
 (0)