mirror of
https://github.com/denoland/deno.git
synced 2025-10-02 23:24:37 +00:00
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:
parent
f2e30a6f79
commit
03e963f578
9 changed files with 40 additions and 32 deletions
|
@ -181,7 +181,7 @@ impl NpmPackageFsResolver for LocalNpmPackageResolver {
|
|||
Cow::Owned(current_folder.join("node_modules"))
|
||||
};
|
||||
let sub_dir = join_package_name(&node_modules_folder, name);
|
||||
if self.fs.is_dir(&sub_dir) {
|
||||
if self.fs.is_dir_sync(&sub_dir) {
|
||||
// if doing types resolution, only resolve the package if it specifies a types property
|
||||
if mode.is_types() && !name.starts_with("@types/") {
|
||||
let package_json = PackageJson::load_skip_read_permission(
|
||||
|
@ -200,7 +200,7 @@ impl NpmPackageFsResolver for LocalNpmPackageResolver {
|
|||
if mode.is_types() && !name.starts_with("@types/") {
|
||||
let sub_dir =
|
||||
join_package_name(&node_modules_folder, &types_package_name(name));
|
||||
if self.fs.is_dir(&sub_dir) {
|
||||
if self.fs.is_dir_sync(&sub_dir) {
|
||||
return Ok(sub_dir);
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue