| 15835 | } |
| 15836 | |
| 15837 | tl::expected<std::string, errors> url_pattern_init::process_search( |
| 15838 | std::string_view value, process_type type) { |
| 15839 | // Let strippedValue be the given value with a single leading U+003F (?) |
| 15840 | // removed, if any. |
| 15841 | if (value.starts_with("?")) { |
| 15842 | value.remove_prefix(1); |
| 15843 | } |
| 15844 | // We cannot assert that the value is no longer starting with a single |
| 15845 | // question mark because technically it can start. The question is whether or |
| 15846 | // not we should remove the first question mark. Ref: |
| 15847 | // https://github.com/ada-url/ada/pull/992 The spec is not clear on this. |
| 15848 | |
| 15849 | // If type is "pattern" then return strippedValue. |
| 15850 | if (type == process_type::pattern) { |
| 15851 | return std::string(value); |
| 15852 | } |
| 15853 | // Return the result of running canonicalize a search given strippedValue. |
| 15854 | return url_pattern_helpers::canonicalize_search(value); |
| 15855 | } |
| 15856 | |
| 15857 | tl::expected<std::string, errors> url_pattern_init::process_hash( |
| 15858 | std::string_view value, process_type type) { |
nothing calls this directly
no test coverage detected