Refactored nested match expressions for TS parser.
Refactored nested match expressions into inline pattern matching with the help of destructuring with early returns + guard clauses for improved readability and reduced nesting.
Don't have the whole project setup so i checked that lib still builds as normal.
cd ./backend/parsers/windmill-parser-ts
cago b
Hope it helps keep things more organized for the future work. Cool project btw :)
| :rocket: | This description was created by Ellipsis for commit 9feb15282b4e4de4e303992aa3a758f3efef5149 |
|---|
Summary:
Refactored nested match expressions in backend/parsers/windmill-parser-ts/src/lib.rs for improved readability and reduced nesting.
Key points:
- Refactored nested match expressions in
backend/parsers/windmill-parser-ts/src/lib.rs. - Introduced
parse_type,match_label, andmatch_propertieshelper functions. - Improved readability and reduced nesting in
tstype_to_typfunction. - Verified that the library builds successfully with
cargo build.
Generated with :heart: by ellipsis.dev
CLA Assistant Lite bot All contributors have signed the CLA ✍️ ✅
I have read the CLA Document and I hereby sign the CLA
Thanks for your contribution! I'll test it properly this week. Is there a specific reason why you replaced map_while with filter_map? I would also suggest adding an indication in the function names that they are linked to the parsing of oneOfs.
see my previous comment
You're correct , should be map_while() as it was. I Was playing around with few different ideas so i missed this :/ Also fixed naming as you suggested.
Thanks for the review!