diff options
| author | Bartek IwaĆczuk <biwanczuk@gmail.com> | 2023-03-30 03:20:31 +0200 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2023-03-30 03:20:31 +0200 |
| commit | 913e2875c1c31d5ffbc9c0c9ed0e8c63f6143024 (patch) | |
| tree | 439fa7eef067893fde75dfe386d801a090e6c057 /cli/npm | |
| parent | 89bbbd102c6050763105be39a49494a5ffdce35b (diff) | |
refactor(ext/node): add NodeEnv::Fs associated type (#18484)
This commit adds associated type to "NodeEnv" trait, called "Fs".
The "Fs" type has a trait bound on "NodeFs", which specifies APIs
required for all ops and resolution APIs to function.
A "RealFs" implementation of "NodeFs" is exported from the "deno_node"
crate, that provides a default implementation for the trait.
All code in "deno_node" extension was changed to use the "NodeFs" trait
to handle file system operations, instead of relying on APIs from the
standard library.
Diffstat (limited to 'cli/npm')
| -rw-r--r-- | cli/npm/resolvers/local.rs | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/cli/npm/resolvers/local.rs b/cli/npm/resolvers/local.rs index 5a026f0a8..f9cc9b09b 100644 --- a/cli/npm/resolvers/local.rs +++ b/cli/npm/resolvers/local.rs @@ -159,9 +159,9 @@ impl NpmPackageFsResolver for LocalNpmPackageResolver { if sub_dir.is_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( - sub_dir.join("package.json"), - )?; + let package_json = PackageJson::load_skip_read_permission::< + deno_runtime::deno_node::RealFs, + >(sub_dir.join("package.json"))?; if package_json.types.is_some() { return Ok(sub_dir); } |
