Skip to content
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

node:fsからnode:fs/promisesを使うように修正 #4

Merged
merged 2 commits into from
Oct 2, 2024

Conversation

hyphen-o
Copy link
Contributor

@hyphen-o hyphen-o commented Oct 2, 2024

やったこと

node:fsからnode:fs/promisesを使うように修正

詳細

  • node:fsからnode:fs/promisesに変更したことによるasync/awaitの記述の追加
  • readFile汎用関数をreadGitObject関数に名前を変更
  • ファイルが存在するかを確認するexists汎用関数の作成

確認項目

  • これまでのcommandを入力して挙動が変わらない

() => true,
() => false,
);
};
Copy link
Contributor Author

@hyphen-o hyphen-o Oct 2, 2024

Choose a reason for hiding this comment

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

memo
node:fs/promisesにはファイルorディレクトリが存在するかを確認するためのexistsSyncにあたる関数がない.
third-partyライブラリも存在したが,自前でも実装できる内容だったため汎用関数として実装することにする.

@hyphen-o hyphen-o requested a review from S-Nakamur-a October 2, 2024 06:47
Copy link

@S-Nakamur-a S-Nakamur-a left a comment

Choose a reason for hiding this comment

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

LGTM!!

@hyphen-o hyphen-o merged commit 82a4f15 into main Oct 2, 2024
2 checks passed
@hyphen-o hyphen-o deleted the keigo-okamoto/fix-fs-to-promises branch October 2, 2024 06:52
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