| 335 | } |
| 336 | |
| 337 | tl::expected<std::string, errors> url_pattern_init::process_search( |
| 338 | std::string_view value, process_type type) { |
| 339 | // Let strippedValue be the given value with a single leading U+003F (?) |
| 340 | // removed, if any. |
| 341 | if (value.starts_with("?")) { |
| 342 | value.remove_prefix(1); |
| 343 | } |
| 344 | // We cannot assert that the value is no longer starting with a single |
| 345 | // question mark because technically it can start. The question is whether or |
| 346 | // not we should remove the first question mark. Ref: |
| 347 | // https://github.com/ada-url/ada/pull/992 The spec is not clear on this. |
| 348 | |
| 349 | // If type is "pattern" then return strippedValue. |
| 350 | if (type == process_type::pattern) { |
| 351 | return std::string(value); |
| 352 | } |
| 353 | // Return the result of running canonicalize a search given strippedValue. |
| 354 | return url_pattern_helpers::canonicalize_search(value); |
| 355 | } |
| 356 | |
| 357 | tl::expected<std::string, errors> url_pattern_init::process_hash( |
| 358 | std::string_view value, process_type type) { |
nothing calls this directly
no test coverage detected