| 15855 | } |
| 15856 | |
| 15857 | tl::expected<std::string, errors> url_pattern_init::process_hash( |
| 15858 | std::string_view value, process_type type) { |
| 15859 | // Let strippedValue be the given value with a single leading U+0023 (#) |
| 15860 | // removed, if any. |
| 15861 | if (value.starts_with("#")) { |
| 15862 | value.remove_prefix(1); |
| 15863 | } |
| 15864 | ADA_ASSERT_TRUE(!value.starts_with("#")); |
| 15865 | // If type is "pattern" then return strippedValue. |
| 15866 | if (type == process_type::pattern) { |
| 15867 | return std::string(value); |
| 15868 | } |
| 15869 | // Return the result of running canonicalize a hash given strippedValue. |
| 15870 | return url_pattern_helpers::canonicalize_hash(value); |
| 15871 | } |
| 15872 | |
| 15873 | } // namespace ada |
| 15874 |
nothing calls this directly
no test coverage detected