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;
|
||||
|
||||
if (!fields) {
|
||||
return null;
|
||||
return;
|
||||
}
|
||||
const { slug, nodeIdentity } = fields;
|
||||
if (slug.includes('LICENCE')) {
|
||||
return null;
|
||||
return;
|
||||
}
|
||||
try {
|
||||
if (nodeIdentity === 'blockIntroMarkdown') {
|
||||
if (!blocks.some(block => block === frontmatter.block)) {
|
||||
return null;
|
||||
if (!blocks.includes(frontmatter.block)) {
|
||||
return;
|
||||
}
|
||||
} else if (
|
||||
!superBlocks.some(
|
||||
superBlock => superBlock === frontmatter.superBlock
|
||||
)
|
||||
) {
|
||||
return null;
|
||||
} else if (!superBlocks.includes(frontmatter.superBlock)) {
|
||||
return;
|
||||
}
|
||||
const pageBuilder = createByIdentityMap[nodeIdentity](createPage);
|
||||
return pageBuilder(edge);
|
||||
pageBuilder(edge);
|
||||
} catch (e) {
|
||||
console.log(`
|
||||
ident: ${nodeIdentity} does not belong to a function
|
||||
@ -161,7 +157,6 @@ exports.createPages = function createPages({ graphql, actions, reporter }) {
|
||||
|
||||
`);
|
||||
}
|
||||
return null;
|
||||
});
|
||||
|
||||
return null;
|
||||
|
Reference in New Issue
Block a user