| 355 | } |
| 356 | |
| 357 | tl::expected<std::string, errors> url_pattern_init::process_hash( |
| 358 | std::string_view value, process_type type) { |
| 359 | // Let strippedValue be the given value with a single leading U+0023 (#) |
| 360 | // removed, if any. |
| 361 | if (value.starts_with("#")) { |
| 362 | value.remove_prefix(1); |
| 363 | } |
| 364 | ADA_ASSERT_TRUE(!value.starts_with("#")); |
| 365 | // If type is "pattern" then return strippedValue. |
| 366 | if (type == process_type::pattern) { |
| 367 | return std::string(value); |
| 368 | } |
| 369 | // Return the result of running canonicalize a hash given strippedValue. |
| 370 | return url_pattern_helpers::canonicalize_hash(value); |
| 371 | } |
| 372 | |
| 373 | } // namespace ada |
| 374 |
nothing calls this directly
no test coverage detected