-
Notifications
You must be signed in to change notification settings - Fork 3
fix: set file type as isStream #62
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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 || |
Copilot
AI
Nov 23, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
robertsLando
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
|
Yep, sounds good to me @robertsLando . Thank you @NubeDev for the PR! |
robertsLando
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@NubeDev I see there are some lint issues, could you run npm run lint:fix and push new changes please?
see issue #61