Skip to content

Commit

Permalink
fix: nullish examples in examples.json (#1033)
Browse files Browse the repository at this point in the history
Co-authored-by: souvik <[email protected]>
  • Loading branch information
Shiva953 and Souvikns authored Jan 4, 2024
1 parent 25cb5cd commit 718b8e8
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions scripts/fetch-asyncapi-example.js
Original file line number Diff line number Diff line change
Expand Up @@ -81,12 +81,11 @@ const buildCLIListFromExamples = async () => {
value: example
};
} catch (error) {
// Failed for somereason to parse this spec file, ignore for now
console.error(error);
}
});

const exampleList = await Promise.all(buildExampleList);
const exampleList = (await Promise.all(buildExampleList)).filter(item => !!item);
const orderedExampleList = exampleList.sort((a, b) => a.name.localeCompare(b.name));

fs.writeFileSync(path.join(EXAMPLE_DIRECTORY, 'examples.json'), JSON.stringify(orderedExampleList, null, 4));
Expand Down

0 comments on commit 718b8e8

Please sign in to comment.