MCPcopy Create free account
hub / github.com/PowerShell/DSC / invoke

Method invoke

lib/dsc-lib/src/functions/starts_with.rs:32–39  ·  view source on GitHub ↗
(&self, args: &[Value], _context: &Context)

Source from the content-addressed store, hash-verified

30 }
31
32 fn invoke(&self, args: &[Value], _context: &Context) -> Result<Value, DscError> {
33 debug!("{}", t!("functions.startsWith.invoked"));
34 if let (Some(string_to_search), Some(string_to_find)) = (args[0].as_str(), args[1].as_str()) {
35 Ok(Value::Bool(string_to_search.starts_with(string_to_find)))
36 } else {
37 Err(DscError::Parser(t!("functions.invalidArguments").to_string()))
38 }
39 }
40}
41
42#[cfg(test)]

Callers

nothing calls this directly

Calls 2

BoolClass · 0.85
as_strMethod · 0.80

Tested by

no test coverage detected