Skip to content

Commit

Permalink
feat(rulesets): add rule to validate message's examples
Browse files Browse the repository at this point in the history
  • Loading branch information
magicmatatjahu committed May 19, 2022
1 parent d7dc211 commit 10a82b9
Showing 1 changed file with 4 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,11 @@ export interface MessageFragment {
}

function getMessageExamples(message: MessageFragment): Array<{ path: JsonPath; value: MessageExample }> {
if (!Array.isArray(message.examples)) {
return [];
}
return (
message.examples?.map((example, index) => {
message.examples.map((example, index) => {
return {
path: ['examples', index],
value: example,
Expand Down

0 comments on commit 10a82b9

Please sign in to comment.