Skip to content

Commit

Permalink
cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
bartlomieju committed Nov 17, 2024
1 parent 600d042 commit 4b2b357
Show file tree
Hide file tree
Showing 2 changed files with 0 additions and 19 deletions.
15 changes: 0 additions & 15 deletions runtime/permissions/lib.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
// Copyright 2018-2024 the Deno authors. All rights reserved. MIT license.

// use deno_core::error::AnyError;
use deno_core::parking_lot::Mutex;
use deno_core::serde::de;
use deno_core::serde::Deserialize;
Expand Down Expand Up @@ -1121,20 +1120,6 @@ impl EnvQueryDescriptor {
pub fn new(env: impl AsRef<str>) -> Self {
Self(EnvVarName::new(env))
}
pub fn matches(&self, env: &str) -> bool {
let pattern = self.0.as_ref();
if let Some(prefix) = pattern.strip_suffix('*') {
if env.starts_with(prefix) {
return true;
}
}
if let Some(suffix) = pattern.strip_prefix('*') {
if env.ends_with(suffix) {
return true;
}
}
env == pattern
}
}

#[derive(Clone, Eq, PartialEq, Hash, Debug)]
Expand Down
4 changes: 0 additions & 4 deletions tests/specs/permission/process_env_permissions/__test__.jsonc
Original file line number Diff line number Diff line change
Expand Up @@ -12,10 +12,6 @@
"args": "run --allow-env=MYAPP_* main.js",
"output": "Hello\tworld,\nfarewell\ndone\n"
},
{
"args": "run --allow-env=*_HELLO,*_GOODBYE,*_DONE,*_TEST main.js",
"output": "Hello\tworld,\nfarewell\ndone\n"
},
{
"args": "run --allow-env main.js",
"output": "Hello\tworld,\nfarewell\ndone\n"
Expand Down

0 comments on commit 4b2b357

Please sign in to comment.