Skip to content

feat(node_compat): Add a close method to the FileHandle class.#19357

Merged
mmastrac merged 4 commits intodenoland:mainfrom
k-nasa:k-nasa/feat_close_to_filehandle
Jun 5, 2023
Merged

feat(node_compat): Add a close method to the FileHandle class.#19357
mmastrac merged 4 commits intodenoland:mainfrom
k-nasa:k-nasa/feat_close_to_filehandle

Conversation

@k-nasa
Copy link
Copy Markdown
Contributor

@k-nasa k-nasa commented Jun 4, 2023

WHY

ref: #19165

The FileHandle class has many missing methods compared to node.
Add these.

WHAT

  • Add close method

@k-nasa k-nasa marked this pull request as ready for review June 4, 2023 07:36
Co-authored-by: Matt Mastracci <matthew@mastracci.com>

close(): Promise<void> {
// Note that Deno.close is not async
return Promise.resolve(Deno.close(this.fd))
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks like this just needs a semicolon to pass the linter (run tools/format.js) and we're good to go

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oops..

Copy link
Copy Markdown
Contributor

@mmastrac mmastrac left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM! Thanks

@mmastrac mmastrac merged commit d2047f1 into denoland:main Jun 5, 2023
@k-nasa k-nasa deleted the k-nasa/feat_close_to_filehandle branch June 5, 2023 23:02
@k-nasa
Copy link
Copy Markdown
Contributor Author

k-nasa commented Jun 5, 2023

Thanks for your review

bartlomieju pushed a commit that referenced this pull request Jun 8, 2023
## WHY 

ref: #19165

The FileHandle class has many missing methods compared to node.
Add these.

## WHAT

- Add close method

---------

Co-authored-by: Matt Mastracci <matthew@mastracci.com>
@kt3k kt3k mentioned this pull request Sep 10, 2024
24 tasks
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