refactor(docs-infra): rename properties (blacklisted --> ignored) (#29754)
PR Close #29754
This commit is contained in:
parent
c5bba8d9f2
commit
8bbf481d60
|
@ -1,12 +1,12 @@
|
|||
module.exports = function createSitemap() {
|
||||
return {
|
||||
blacklistedDocTypes: [
|
||||
ignoredDocTypes: [
|
||||
'announcements-json',
|
||||
'contributors-json',
|
||||
'navigation-json',
|
||||
'resources-json',
|
||||
],
|
||||
blacklistedPaths: [
|
||||
ignoredPaths: [
|
||||
'file-not-found',
|
||||
'overview-dump',
|
||||
'test',
|
||||
|
@ -23,8 +23,8 @@ module.exports = function createSitemap() {
|
|||
// Filter out docs that are not outputted
|
||||
.filter(doc => doc.outputPath)
|
||||
// Filter out unwanted docs
|
||||
.filter(doc => this.blacklistedDocTypes.indexOf(doc.docType) === -1)
|
||||
.filter(doc => this.blacklistedPaths.indexOf(doc.path) === -1)
|
||||
.filter(doc => this.ignoredDocTypes.indexOf(doc.docType) === -1)
|
||||
.filter(doc => this.ignoredPaths.indexOf(doc.path) === -1)
|
||||
// Capture the path of each doc
|
||||
.map(doc => doc.path)
|
||||
// Convert the homepage: `index` to `/`
|
||||
|
|
|
@ -53,7 +53,7 @@ describe('createSitemap processor', () => {
|
|||
{ path: 'cde', outputPath: 'cde', docType: 'bad' },
|
||||
{ path: 'fgh', outputPath: 'fgh', docType: 'good' },
|
||||
];
|
||||
processor.blacklistedDocTypes = ['bad'];
|
||||
processor.ignoredDocTypes = ['bad'];
|
||||
processor.$process(docs);
|
||||
expect(docs.pop().urls).toEqual(['abc', 'fgh']);
|
||||
});
|
||||
|
@ -64,7 +64,7 @@ describe('createSitemap processor', () => {
|
|||
{ path: 'cde', outputPath: 'cde' },
|
||||
{ path: 'fgh', outputPath: 'fgh' },
|
||||
];
|
||||
processor.blacklistedPaths = ['cde'];
|
||||
processor.ignoredPaths = ['cde'];
|
||||
processor.$process(docs);
|
||||
expect(docs.pop().urls).toEqual(['abc', 'fgh']);
|
||||
});
|
||||
|
@ -80,4 +80,4 @@ describe('createSitemap processor', () => {
|
|||
});
|
||||
});
|
||||
});
|
||||
});
|
||||
});
|
||||
|
|
Loading…
Reference in New Issue