pub fn get_preset_tlds_with_custom(
preset: &str,
custom_presets: Option<&HashMap<String, Vec<String>>>,
) -> Option<Vec<String>>
Expand description
Get predefined TLD presets with custom preset support.
This function checks custom presets first, then falls back to built-in presets.
§Arguments
preset
- The preset name to look upcustom_presets
- Optional custom presets from config files
§Returns
Optional vector of TLD strings, None if preset doesn’t exist.
§Examples
use std::collections::HashMap;
use domain_check_lib::get_preset_tlds_with_custom;
let mut custom = HashMap::new();
custom.insert("my_preset".to_string(), vec!["com".to_string(), "dev".to_string()]);
let tlds = get_preset_tlds_with_custom("my_preset", Some(&custom)).unwrap();
assert_eq!(tlds, vec!["com", "dev"]);