Skip to content

refactor plan parsing - #788

Merged
pgiraud merged 2 commits into
dalibo:masterfrom
dlax:jsonparse
Aug 21, 2025
Merged

refactor plan parsing#788
pgiraud merged 2 commits into
dalibo:masterfrom
dlax:jsonparse

Conversation

@dlax

@dlax dlax commented Aug 19, 2025

Copy link
Copy Markdown
Contributor

Some changes I found sensible (but might not) while reviewing (getting familiar with) the code.

Comment thread src/services/plan-service.ts Outdated
dlax added 2 commits August 20, 2025 08:19
In PlanService.fromSource() we were JSON parsing the source value to
determine if it was valid JSON and then passing the original source to
parseJson() which again parsed that value. We now only parse the value
once before calling this parseJson() method. That method is renamed as
getPlanContent(), made private and its inaccurate comment is removed.
PlanService.createPlan() declares its `planContent` parameter as an
`IPlanContent` type, which must have a `Plan` property, but also checks
its presence. Instead, move this check at parse stage so as to make the
assumptions consistent.
@dlax
dlax requested a review from pgiraud August 20, 2025 06:20
@pgiraud
pgiraud merged commit fe17fee into dalibo:master Aug 21, 2025
2 checks passed
@dlax
dlax deleted the jsonparse branch August 21, 2025 06:35
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants