mirror of
https://github.com/LadybirdBrowser/ladybird
synced 2026-05-05 06:32:30 +02:00
LibJS: Provide public access to list of sanctioned unit identifiers
This commit is contained in:
committed by
Linus Groh
parent
98348d9a33
commit
a120e85596
Notes:
sideshowbarker
2024-07-18 03:23:00 +09:00
Author: https://github.com/trflynn89 Commit: https://github.com/SerenityOS/serenity/commit/a120e85596c Pull-request: https://github.com/SerenityOS/serenity/pull/12223 Reviewed-by: https://github.com/linusg ✅
@@ -6,6 +6,7 @@
|
||||
|
||||
#pragma once
|
||||
|
||||
#include <AK/Array.h>
|
||||
#include <AK/Span.h>
|
||||
#include <AK/String.h>
|
||||
#include <AK/Variant.h>
|
||||
@@ -53,6 +54,11 @@ struct PatternPartition {
|
||||
String value;
|
||||
};
|
||||
|
||||
constexpr auto sanctioned_simple_unit_identifiers()
|
||||
{
|
||||
return AK::Array { "acre"sv, "bit"sv, "byte"sv, "celsius"sv, "centimeter"sv, "day"sv, "degree"sv, "fahrenheit"sv, "fluid-ounce"sv, "foot"sv, "gallon"sv, "gigabit"sv, "gigabyte"sv, "gram"sv, "hectare"sv, "hour"sv, "inch"sv, "kilobit"sv, "kilobyte"sv, "kilogram"sv, "kilometer"sv, "liter"sv, "megabit"sv, "megabyte"sv, "meter"sv, "mile"sv, "mile-scandinavian"sv, "milliliter"sv, "millimeter"sv, "millisecond"sv, "minute"sv, "month"sv, "ounce"sv, "percent"sv, "petabyte"sv, "pound"sv, "second"sv, "stone"sv, "terabit"sv, "terabyte"sv, "week"sv, "yard"sv, "year"sv };
|
||||
}
|
||||
|
||||
Optional<Unicode::LocaleID> is_structurally_valid_language_tag(StringView locale);
|
||||
String canonicalize_unicode_locale_id(Unicode::LocaleID& locale);
|
||||
bool is_well_formed_currency_code(StringView currency);
|
||||
|
||||
Reference in New Issue
Block a user