| 9132 | |
| 9133 | template <url_pattern_regex::regex_concept regex_provider> |
| 9134 | result<bool> url_pattern<regex_provider>::test( |
| 9135 | const url_pattern_input& input, const std::string_view* base_url) { |
| 9136 | // TODO: Optimization opportunity. Rather than returning `url_pattern_result` |
| 9137 | // Implement a fast path just like `can_parse()` in ada_url. |
| 9138 | // Let result be the result of match given this's associated URL pattern, |
| 9139 | // input, and baseURL if given. |
| 9140 | // If result is null, return false. |
| 9141 | if (auto result = match(input, base_url); result.has_value()) { |
| 9142 | return result->has_value(); |
| 9143 | } |
| 9144 | return tl::unexpected(errors::type_error); |
| 9145 | } |
| 9146 | |
| 9147 | template <url_pattern_regex::regex_concept regex_provider> |
| 9148 | result<std::optional<url_pattern_result>> url_pattern<regex_provider>::match( |