fix(client): remove unnecessary return values (#42927)
* remove returns * change .some() to .includes()
This commit is contained in:
@ -132,26 +132,22 @@ exports.createPages = function createPages({ graphql, actions, reporter }) {
|
|||||||
} = edge;
|
} = edge;
|
||||||
|
|
||||||
if (!fields) {
|
if (!fields) {
|
||||||
return null;
|
return;
|
||||||
}
|
}
|
||||||
const { slug, nodeIdentity } = fields;
|
const { slug, nodeIdentity } = fields;
|
||||||
if (slug.includes('LICENCE')) {
|
if (slug.includes('LICENCE')) {
|
||||||
return null;
|
return;
|
||||||
}
|
}
|
||||||
try {
|
try {
|
||||||
if (nodeIdentity === 'blockIntroMarkdown') {
|
if (nodeIdentity === 'blockIntroMarkdown') {
|
||||||
if (!blocks.some(block => block === frontmatter.block)) {
|
if (!blocks.includes(frontmatter.block)) {
|
||||||
return null;
|
return;
|
||||||
}
|
}
|
||||||
} else if (
|
} else if (!superBlocks.includes(frontmatter.superBlock)) {
|
||||||
!superBlocks.some(
|
return;
|
||||||
superBlock => superBlock === frontmatter.superBlock
|
|
||||||
)
|
|
||||||
) {
|
|
||||||
return null;
|
|
||||||
}
|
}
|
||||||
const pageBuilder = createByIdentityMap[nodeIdentity](createPage);
|
const pageBuilder = createByIdentityMap[nodeIdentity](createPage);
|
||||||
return pageBuilder(edge);
|
pageBuilder(edge);
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
console.log(`
|
console.log(`
|
||||||
ident: ${nodeIdentity} does not belong to a function
|
ident: ${nodeIdentity} does not belong to a function
|
||||||
@ -161,7 +157,6 @@ exports.createPages = function createPages({ graphql, actions, reporter }) {
|
|||||||
|
|
||||||
`);
|
`);
|
||||||
}
|
}
|
||||||
return null;
|
|
||||||
});
|
});
|
||||||
|
|
||||||
return null;
|
return null;
|
||||||
|
Reference in New Issue
Block a user