summaryrefslogtreecommitdiff
path: root/Userland/Libraries/LibJS/Runtime/Intl/AbstractOperations.h
diff options
context:
space:
mode:
authorTimothy Flynn <trflynn89@pm.me>2022-01-30 17:46:38 -0500
committerLinus Groh <mail@linusgroh.de>2022-01-31 00:32:41 +0000
commita120e85596cc671a60ed1f29c7e6d8f95870f203 (patch)
treefd3094037bdb52eb29bd180a42166e8423b36188 /Userland/Libraries/LibJS/Runtime/Intl/AbstractOperations.h
parent98348d9a33bafe1a934600c7da2c5ff8133c77d5 (diff)
downloadserenity-a120e85596cc671a60ed1f29c7e6d8f95870f203.zip
LibJS: Provide public access to list of sanctioned unit identifiers
Diffstat (limited to 'Userland/Libraries/LibJS/Runtime/Intl/AbstractOperations.h')
-rw-r--r--Userland/Libraries/LibJS/Runtime/Intl/AbstractOperations.h6
1 files changed, 6 insertions, 0 deletions
diff --git a/Userland/Libraries/LibJS/Runtime/Intl/AbstractOperations.h b/Userland/Libraries/LibJS/Runtime/Intl/AbstractOperations.h
index b45b65b458..b1ab96f66f 100644
--- a/Userland/Libraries/LibJS/Runtime/Intl/AbstractOperations.h
+++ b/Userland/Libraries/LibJS/Runtime/Intl/AbstractOperations.h
@@ -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);