MCPcopy Create free account
hub / github.com/ada-url/ada / process_hash

Method process_hash

src/url_pattern.cpp:357–371  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

355}
356
357tl::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

Callers

nothing calls this directly

Calls 1

canonicalize_hashFunction · 0.85

Tested by

no test coverage detected