Make most operations have a more friendly return type
- Dominant language
- JavaScript
- Stars
- 35.8k
- Forks
- 4.1k
- Avg merge
- 2d 26m
- Merged PRs (30d)
- 33
Description
In the context of the CyberChef server, where the response will generally be consumed by some other application, it would be better to have as many operations as reasonable return JSON, a string or integer, rather than a presentation layer output like HTML
Let's move the HTML presentation to the `present` function of those operations so that the programmatic API is more friendly.
Example operations that could be amended to move the html output to the present function:
- Diff
- ParseColourCode
- ParseDateTime
- ParseIPv4Header
- ToTable (arguably)
Example operations that its probably better to leave as is:
- HeatmapChart
- HexDensityChart
- *Chart
Contributor guide
Research direction
Start by reviewing the operation implementations named in the issue—Diff, ParseColourCode, ParseDateTime, ParseIPv4Header and ToTable—and how their present functions are used. Compare their current operation outputs with the server's programmatic responses. Done means reasonable non-chart operations return JSON, strings or integers while HTML remains in presentation handling.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- javascript
- Domain
- api, backend
- Issue type
- Refactor
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 25/100