MCPcopy Create free account
hub / github.com/awslabs/llrt / has

Method has

modules/llrt_fetch/src/headers.rs:181–188  ·  view source on GitHub ↗
(&self, ctx: Ctx<'js>, key: String)

Source from the content-addressed store, hash-verified

179 }
180
181 pub fn has<'js>(&self, ctx: Ctx<'js>, key: String) -> Result<bool> {
182 let key = lower_key(key);
183 if !is_http_header_name(&key) {
184 return Err(Exception::throw_type(&ctx, "Invalid key"));
185 }
186
187 Ok(self.headers.iter().any(|(k, _)| k == &key))
188 }
189
190 pub fn set<'js>(&mut self, ctx: Ctx<'js>, key: String, value: Value<'js>) -> Result<()> {
191 let key = lower_key(key);

Callers 7

tickMethod · 0.45
hasAsymmetricFunction · 0.45
iterableEqualityFunction · 0.45
url.test.tsFile · 0.45
postSetupFunction · 0.45

Calls 4

lower_keyFunction · 0.85
is_http_header_nameFunction · 0.85
anyMethod · 0.80
iterMethod · 0.45

Tested by

no test coverage detected