summaryrefslogtreecommitdiff
path: root/Userland/Libraries/LibJS/Runtime/Intl/SingleUnitIdentifiers.h
blob: 624ed060e9122ee38fb82b663a2164469547db0f (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
/*
 * Copyright (c) 2022, the SerenityOS developers.
 *
 * SPDX-License-Identifier: BSD-2-Clause
 */

#pragma once

#include <AK/Array.h>
#include <AK/StringView.h>

namespace JS::Intl {

// Table 2: Single units sanctioned for use in ECMAScript, https://tc39.es/ecma402/#table-sanctioned-single-unit-identifiers
constexpr auto sanctioned_single_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,
    };
}

// Additional single units used in ECMAScript required by the Intl.DurationFormat proposal
constexpr auto extra_sanctioned_single_unit_identifiers()
{
    return AK::Array { "microsecond"sv, "nanosecond"sv };
}

}