chore: rename some helpers on the Fs trait (#20097)

Rename some of the helper methods on the Fs trait to be suffixed with
`_sync` / `_async`, in preparation of the introduction of more async
methods for some helpers.

Also adds a `read_text_file_async` helper to complement the renamed
`read_text_file_sync` helper.
This commit is contained in:
Luca Casonato 2023-08-08 16:28:18 -04:00 committed by GitHub
parent f2e30a6f79
commit 03e963f578
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
9 changed files with 40 additions and 32 deletions

View file

@ -745,7 +745,7 @@ impl NpmModuleLoader {
let file_path = specifier.to_file_path().unwrap();
let code = self
.fs
.read_to_string(&file_path)
.read_text_file_sync(&file_path)
.map_err(AnyError::from)
.with_context(|| {
if file_path.is_dir() {