HarperFast / HarperFast/harper
`export_local` creates file with double file extension
- Dominant language
- JavaScript
- Stars
- 89
- Forks
- 10
- Avg merge
- 2d 6h
- Merged PRs (30d)
- 200
Description
### Bug Summary
When `filename` is specified, it appends `.json` regardless if the file already has the extension
### Reproduction Repository (if applicable)
_No response_
### Steps to Reproduce
Call `export_local` with a `filename` such as `test.json` and it will produce a file called `test.json.json`.
```
req()
.send({
operation: 'export_local',
path: './',
filename: 'test.json',
format: 'json'
});
```
### Expected Behavior
Should only append the format file extension if the `filename` doesn't have the extension already.
### Actual Behavior
Export will create a file with double extension (e.g. `test.json.json`).
### Platform
Harper 5 (main branch)
### Console Errors
_No response_
### Screenshots or Videos
_No response_
### Additional Context
This issue was found while running integration tests, namely `7_jobsAndJobRoleTesting.mjs`.
### Are you planning to fix this issue?
No, just reporting the issue
### First-time contributor support
- [ ] I'm new to contributing and would appreciate guidance on the process
- [ ] I'd like help understanding the project structure
- [ ] I need assistance with setting up the development environment
- [ ] I'm comfortable contributing, but new to this project specifically
Contributor guide
Assessment
This issue has not been assessed yet.