Skip to content

Commit

Permalink
fix(ci): only one deriving clause is necessary
Browse files Browse the repository at this point in the history
  • Loading branch information
W95Psp committed Jun 3, 2024
1 parent a483aff commit 2ec6cb9
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions engine/utils/ocaml_of_json_schema/ocaml_of_json_schema.js
Original file line number Diff line number Diff line change
Expand Up @@ -532,8 +532,14 @@ end
open ParseError
`;

impl += ('type ' + items.map(({name, type}) =>
`${name} = ${type}\n${derive_items.length ? `[@@deriving ${derive_items.join(', ')}]` : ''}`).join('\nand ')
let derive_clause = derive_items.length ? `[@@deriving ${derive_items.join(', ')}]` : '';

impl += (
'type '
+ items.map(({name, type}) =>
`${name} = ${type}\n`
).join('\nand ')
+ derive_clause
);
impl += ('');
impl += ('let rec ' + items.map(({name, type, parse}) =>
Expand Down

0 comments on commit 2ec6cb9

Please sign in to comment.