summaryrefslogtreecommitdiff
path: root/ext/node/package_json.rs
diff options
context:
space:
mode:
authorDavid Sherret <dsherret@users.noreply.github.com>2022-10-21 11:20:18 -0400
committerGitHub <noreply@github.com>2022-10-21 15:20:18 +0000
commitbcfe279fba865763c87f9cd8d5a2d0b2cbf451be (patch)
tree68e4d1bc52e261df50279f9ecea14795d1c46f6c /ext/node/package_json.rs
parent0e1a71fec6fff5fe62d7e6b2bfffb7ab877d7b71 (diff)
feat(unstable/npm): initial type checking of npm specifiers (#16332)
Diffstat (limited to 'ext/node/package_json.rs')
-rw-r--r--ext/node/package_json.rs6
1 files changed, 6 insertions, 0 deletions
diff --git a/ext/node/package_json.rs b/ext/node/package_json.rs
index 81daa7ca7..85caac5f4 100644
--- a/ext/node/package_json.rs
+++ b/ext/node/package_json.rs
@@ -50,6 +50,12 @@ impl PackageJson {
path: PathBuf,
) -> Result<PackageJson, AnyError> {
resolver.ensure_read_permission(&path)?;
+ Self::load_skip_read_permission(path)
+ }
+
+ pub fn load_skip_read_permission(
+ path: PathBuf,
+ ) -> Result<PackageJson, AnyError> {
let source = match std::fs::read_to_string(&path) {
Ok(source) => source,
Err(err) if err.kind() == ErrorKind::NotFound => {