Skip to content

Commit

Permalink
better conditional
Browse files Browse the repository at this point in the history
  • Loading branch information
taylordowns2000 committed Jan 30, 2024
1 parent bd7c0a1 commit a62e440
Show file tree
Hide file tree
Showing 2 changed files with 12,252 additions and 8,668 deletions.
5 changes: 2 additions & 3 deletions sidebars-adaptors.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ const fs = require('fs');
// Note that we'd like a way to start the docs site even if the
// generate-adaptors code has not yet been run. This if/else is not very elegent
// but does the trick.
let list = [];
if (fs.existsSync('./adaptors/packages/publicPaths.json')) {
const adaptorsFile = fs.readFileSync('./adaptors/packages/publicPaths.json');
const adaptors = JSON.parse(adaptorsFile);
Expand Down Expand Up @@ -86,9 +87,7 @@ if (fs.existsSync('./adaptors/packages/publicPaths.json')) {
.filter(id => !adaptors.map(a => `${a.name}`).includes(id))
.map(id => ({ type: 'doc', id, label: id }));

const list = [...items, ...extras].sort((a, b) =>
a.label.localeCompare(b.label)
);
list = [...items, ...extras].sort((a, b) => a.label.localeCompare(b.label));
} else {
list = [];
}
Expand Down
Loading

0 comments on commit a62e440

Please sign in to comment.