Conversation
There was a problem hiding this comment.
Pull request overview
This PR fixes an issue where the writeFile method couldn't properly set the file access type (stream vs record-oriented). The fix introduces a new WriteFileOptions interface that extends ServiceOptions with an isStream boolean parameter, allowing callers to explicitly specify whether they want stream-based or record-based file access.
Key changes:
- Added
WriteFileOptionsinterface with optionalisStreamparameter - Updated
writeFilemethod to useWriteFileOptionsand properly handle theisStreamoption - Default behavior now explicitly uses stream mode when not specified
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 1 comment.
| File | Description |
|---|---|
| src/lib/types.ts | Introduces WriteFileOptions interface extending ServiceOptions with isStream parameter |
| src/lib/client.ts | Updates writeFile method to accept WriteFileOptions, extracts isStream value with stream mode as default, and passes it to the encoder |
src/lib/client.ts
Outdated
| const settings = { | ||
| maxSegments: | ||
| (options as ServiceOptions).maxSegments || | ||
| (options as WriteFileOptions).maxSegments || |
There was a problem hiding this comment.
The type assertion (options as WriteFileOptions) is redundant since options is already typed as WriteFileOptions in the function signature. Remove the type assertions on lines 1290, 1293, and 1296.
|
Yep, sounds good to me @robertsLando . Thank you @NubeDev for the PR! |
robertsLando
left a comment
There was a problem hiding this comment.
@NubeDev I see there are some lint issues, could you run npm run lint:fix and push new changes please?
see issue #61