(mode: &str)
| 2609 | } |
| 2610 | |
| 2611 | fn parse_planning_mode(mode: &str) -> napi::Result<RustPlanningMode> { |
| 2612 | match mode.trim().to_ascii_lowercase().as_str() { |
| 2613 | "auto" => Ok(RustPlanningMode::Auto), |
| 2614 | "enabled" | "enable" | "on" | "force" | "forced" | "true" => Ok(RustPlanningMode::Enabled), |
| 2615 | "disabled" | "disable" | "off" | "false" => Ok(RustPlanningMode::Disabled), |
| 2616 | _ => Err(napi::Error::from_reason(format!( |
| 2617 | "Invalid planningMode '{}'. Must be: auto, enabled, or disabled", |
| 2618 | mode |
| 2619 | ))), |
| 2620 | } |
| 2621 | } |
| 2622 | |
| 2623 | fn parse_permission_decision(value: Option<String>) -> napi::Result<RustPermissionDecision> { |
| 2624 | match value |
no test coverage detected