Latest Threat Research:SANDWORM_MODE: Shai-Hulud-Style npm Worm Hijacks CI Workflows and Poisons AI Toolchains.Details →
Socket
Book a DemoInstallSign in
Socket

@formatjs/ecma402-abstract

Package Overview
Dependencies
Maintainers
3
Versions
92
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@formatjs/ecma402-abstract - npm Package Compare versions

Comparing version
3.0.6
to
3.0.7
+8
-1
CanonicalizeTimeZoneName.d.ts
/**
* CanonicalizeTimeZoneName ( timeZone )
* https://tc39.es/ecma402/#sec-canonicalizetimezonename
* @param tz
*
* Extended to support UTC offset time zones per ECMA-402 PR #788 (ES2026).
* Returns the canonical and case-regularized form of a timezone identifier.
*
* @param tz - The timezone identifier to canonicalize
* @param implDetails - Implementation details containing timezone data
* @returns The canonical timezone identifier
*/

@@ -5,0 +12,0 @@ export declare function CanonicalizeTimeZoneName(tz: string, { zoneNames, uppercaseLinks, }: {

@@ -0,7 +1,79 @@

// Cached regex patterns for performance
var OFFSET_TIMEZONE_PREFIX_REGEX = /^[+-]/;
var OFFSET_TIMEZONE_FORMAT_REGEX = /^([+-])(\d{2})(?::?(\d{2}))?(?::?(\d{2}))?(?:\.(\d{1,9}))?$/;
var TRAILING_ZEROS_REGEX = /0+$/;
/**
* IsTimeZoneOffsetString ( offsetString )
* https://tc39.es/ecma262/#sec-istimezoneoffsetstring
*
* Simplified check to determine if a string is a UTC offset identifier.
*
* @param offsetString - The string to check
* @returns true if offsetString starts with '+' or '-'
*/
function IsTimeZoneOffsetString(offsetString) {
// 1. If offsetString does not start with '+' or '-', return false
return OFFSET_TIMEZONE_PREFIX_REGEX.test(offsetString);
}
/**
* ParseTimeZoneOffsetString ( offsetString )
* https://tc39.es/ecma262/#sec-parsetimezoneoffsetstring
*
* Parses a UTC offset string and returns its canonical representation.
* Normalizes various formats (±HH, ±HHMM, ±HH:MM, etc.) to ±HH:MM format.
*
* @param offsetString - The UTC offset string to parse
* @returns The canonical offset string in ±HH:MM format (with :SS.sss if non-zero)
*/
function ParseTimeZoneOffsetString(offsetString) {
// 1. Let parseResult be ParseText(offsetString, UTCOffset)
var match = OFFSET_TIMEZONE_FORMAT_REGEX.exec(offsetString);
// 2. Assert: parseResult is not a List of errors (validated by IsValidTimeZoneName)
if (!match) {
return offsetString;
}
// 3. Extract components from parseResult
var sign = match[1];
var hours = match[2];
var minutes = match[3] ? match[3] : '00';
var seconds = match[4];
var fractional = match[5];
// 4. Build canonical format: ±HH:MM
var canonical = "".concat(sign).concat(hours, ":").concat(minutes);
// 5. If seconds are present and non-zero (or fractional present), include them
if (seconds && (parseInt(seconds, 10) !== 0 || fractional)) {
canonical += ":".concat(seconds);
// 6. If fractional seconds present, include them (trim trailing zeros)
if (fractional) {
var trimmedFractional = fractional.replace(TRAILING_ZEROS_REGEX, '');
if (trimmedFractional) {
canonical += ".".concat(trimmedFractional);
}
}
}
// 7. Return canonical representation
return canonical;
}
/**
* CanonicalizeTimeZoneName ( timeZone )
* https://tc39.es/ecma402/#sec-canonicalizetimezonename
* @param tz
*
* Extended to support UTC offset time zones per ECMA-402 PR #788 (ES2026).
* Returns the canonical and case-regularized form of a timezone identifier.
*
* @param tz - The timezone identifier to canonicalize
* @param implDetails - Implementation details containing timezone data
* @returns The canonical timezone identifier
*/
export function CanonicalizeTimeZoneName(tz, _a) {
var zoneNames = _a.zoneNames, uppercaseLinks = _a.uppercaseLinks;
// 1. If IsTimeZoneOffsetString(timeZone) is true, then
// a. Return ParseTimeZoneOffsetString(timeZone)
// Per ECMA-402 PR #788, UTC offset identifiers are canonicalized
if (IsTimeZoneOffsetString(tz)) {
return ParseTimeZoneOffsetString(tz);
}
// 2. Let ianaTimeZone be the String value of the Zone or Link name
// in the IANA Time Zone Database that is an ASCII-case-insensitive
// match of timeZone
var uppercasedTz = tz.toUpperCase();

@@ -13,6 +85,8 @@ var uppercasedZones = zoneNames.reduce(function (all, z) {

var ianaTimeZone = uppercaseLinks[uppercasedTz] || uppercasedZones[uppercasedTz];
// 3. If ianaTimeZone is "Etc/UTC" or "Etc/GMT", return "UTC"
if (ianaTimeZone === 'Etc/UTC' || ianaTimeZone === 'Etc/GMT') {
return 'UTC';
}
// 4. Return ianaTimeZone
return ianaTimeZone;
}
/**
* IsValidTimeZoneName ( timeZone )
* https://tc39.es/ecma402/#sec-isvalidtimezonename
* @param tz
* @param implDetails implementation details
*
* Extended to support UTC offset time zones per ECMA-402 PR #788 (ES2026).
* The abstract operation validates both:
* 1. UTC offset identifiers (e.g., "+01:00", "-05:30")
* 2. Available named time zone identifiers from IANA Time Zone Database
*
* @param tz - The timezone identifier to validate
* @param implDetails - Implementation details containing timezone data
* @returns true if timeZone is a valid identifier
*/

@@ -6,0 +14,0 @@ export declare function IsValidTimeZoneName(tz: string, { zoneNamesFromData, uppercaseLinks, }: {

@@ -0,8 +1,59 @@

// Cached regex patterns for performance
var OFFSET_TIMEZONE_PREFIX_REGEX = /^[+-]/;
var OFFSET_TIMEZONE_FORMAT_REGEX = /^([+-])(\d{2})(?::?(\d{2}))?(?::?(\d{2}))?(?:\.(\d{1,9}))?$/;
/**
* IsTimeZoneOffsetString ( offsetString )
* https://tc39.es/ecma262/#sec-istimezoneoffsetstring
*
* Validates whether a string represents a valid UTC offset timezone.
* Supports formats: ±HH, ±HHMM, ±HH:MM, ±HH:MM:SS, ±HH:MM:SS.sss
*
* @param offsetString - The string to validate as a timezone offset
* @returns true if offsetString is a valid UTC offset format
*/
function IsTimeZoneOffsetString(offsetString) {
// 1. If offsetString does not start with '+' or '-', return false
if (!OFFSET_TIMEZONE_PREFIX_REGEX.test(offsetString)) {
return false;
}
// 2. Let parseResult be ParseText(offsetString, UTCOffset)
var match = OFFSET_TIMEZONE_FORMAT_REGEX.exec(offsetString);
// 3. If parseResult is a List of errors, return false
if (!match) {
return false;
}
// 4. Validate component ranges per ECMA-262 grammar
// Hour must be 0-23, Minute must be 0-59, Second must be 0-59
var hours = parseInt(match[2], 10);
var minutes = match[3] ? parseInt(match[3], 10) : 0;
var seconds = match[4] ? parseInt(match[4], 10) : 0;
if (hours > 23 || minutes > 59 || seconds > 59) {
return false;
}
// 5. Return true
return true;
}
/**
* IsValidTimeZoneName ( timeZone )
* https://tc39.es/ecma402/#sec-isvalidtimezonename
* @param tz
* @param implDetails implementation details
*
* Extended to support UTC offset time zones per ECMA-402 PR #788 (ES2026).
* The abstract operation validates both:
* 1. UTC offset identifiers (e.g., "+01:00", "-05:30")
* 2. Available named time zone identifiers from IANA Time Zone Database
*
* @param tz - The timezone identifier to validate
* @param implDetails - Implementation details containing timezone data
* @returns true if timeZone is a valid identifier
*/
export function IsValidTimeZoneName(tz, _a) {
var zoneNamesFromData = _a.zoneNamesFromData, uppercaseLinks = _a.uppercaseLinks;
// 1. If IsTimeZoneOffsetString(timeZone) is true, return true
// Per ECMA-402 PR #788, UTC offset identifiers are valid
if (IsTimeZoneOffsetString(tz)) {
return true;
}
// 2. Let timeZones be AvailableNamedTimeZoneIdentifiers()
// 3. If timeZones contains an element equal to timeZone, return true
// NOTE: Implementation uses case-insensitive comparison per spec note
var uppercasedTz = tz.toUpperCase();

@@ -16,3 +67,7 @@ var zoneNames = new Set();

});
return zoneNames.has(uppercasedTz) || linkNames.has(uppercasedTz);
if (zoneNames.has(uppercasedTz) || linkNames.has(uppercasedTz)) {
return true;
}
// 4. Return false
return false;
}

@@ -47,3 +47,12 @@ import { Decimal } from 'decimal.js';

if (num > thresholds[thresholds.length - 1]) {
return thresholds[thresholds.length - 1].length - 1;
// GH #4236: When number exceeds max threshold, use the exponent
// corresponding to the largest available threshold in locale data.
// Calculate exponent the same way as for normal thresholds (lines 70-73).
var magnitudeKey_1 = thresholds[thresholds.length - 1];
var compactPattern_1 = thresholdMap[magnitudeKey_1].other;
if (compactPattern_1 === '0') {
return 0;
}
return (magnitudeKey_1.length -
thresholdMap[magnitudeKey_1].other.match(/0+/)[0].length);
}

@@ -50,0 +59,0 @@ var i = thresholds.indexOf(num);

+65
-780
export var digitMapping = {
"adlm": [
"šž„",
"šž„‘",
"šž„’",
"šž„“",
"šž„”",
"šž„•",
"šž„–",
"šž„—",
"šž„˜",
"šž„™"
],
"ahom": [
"š‘œ°",
"š‘œ±",
"š‘œ²",
"š‘œ³",
"š‘œ“",
"š‘œµ",
"š‘œ¶",
"š‘œ·",
"š‘œø",
"š‘œ¹"
],
"arab": [
"Ł ",
"Ł”",
"Ł¢",
"Ł£",
"٤",
"Ł„",
"٦",
"٧",
"ŁØ",
"Ł©"
],
"arabext": [
"Ū°",
"Ū±",
"Ū²",
"Ū³",
"Ū“",
"Ūµ",
"Ū¶",
"Ū·",
"Ūø",
"Ū¹"
],
"bali": [
"᭐",
"į­‘",
"į­’",
"į­“",
"į­”",
"į­•",
"į­–",
"į­—",
"᭘",
"į­™"
],
"beng": [
"০",
"ą§§",
"ą§Ø",
"ą§©",
"ą§Ŗ",
"ą§«",
"৬",
"ą§­",
"ą§®",
"ą§Æ"
],
"bhks": [
"𑱐",
"𑱑",
"𑱒",
"𑱓",
"𑱔",
"𑱕",
"𑱖",
"𑱗",
"š‘±˜",
"𑱙"
],
"brah": [
"𑁦",
"𑁧",
"𑁨",
"𑁩",
"𑁪",
"𑁫",
"𑁬",
"𑁭",
"𑁮",
"𑁯"
],
"cakm": [
"š‘„¶",
"š‘„·",
"š‘„ø",
"š‘„¹",
"š‘„ŗ",
"š‘„»",
"š‘„¼",
"š‘„½",
"š‘„¾",
"š‘„æ"
],
"cham": [
"꩐",
"ź©‘",
"ź©’",
"ź©“",
"ź©”",
"ź©•",
"ź©–",
"ź©—",
"꩘",
"ź©™"
],
"deva": [
"ą„¦",
"ą„§",
"ą„Ø",
"ą„©",
"ą„Ŗ",
"ą„«",
"ą„¬",
"ą„­",
"ą„®",
"ą„Æ"
],
"diak": [
"𑄐",
"š‘„‘",
"š‘„’",
"š‘„“",
"š‘„”",
"š‘„•",
"š‘„–",
"š‘„—",
"š‘„˜",
"š‘„™"
],
"fullwide": [
"0",
"1",
"ļ¼’",
"3",
"ļ¼”",
"5",
"ļ¼–",
"ļ¼—",
"8",
"ļ¼™"
],
"gong": [
"š‘¶ ",
"š‘¶”",
"š‘¶¢",
"š‘¶£",
"𑶤",
"š‘¶„",
"𑶦",
"š‘¶§",
"š‘¶Ø",
"š‘¶©"
],
"gonm": [
"𑵐",
"𑵑",
"𑵒",
"𑵓",
"𑵔",
"𑵕",
"𑵖",
"𑵗",
"š‘µ˜",
"𑵙"
],
"gujr": [
"૦",
"ą«§",
"૨",
"ą«©",
"૪",
"ą««",
"૬",
"ą«­",
"ą«®",
"૯"
],
"guru": [
"੦",
"ą©§",
"੨",
"ą©©",
"੪",
"ą©«",
"੬",
"ą©­",
"ą©®",
"੯"
],
"hanidec": [
"怇",
"äø€",
"二",
"äø‰",
"四",
"äŗ”",
"六",
"七",
"八",
"九"
],
"hmng": [
"𖭐",
"š–­‘",
"š–­’",
"š–­“",
"š–­”",
"š–­•",
"š–­–",
"š–­—",
"š–­˜",
"š–­™"
],
"hmnp": [
"šž…€",
"šž…",
"šž…‚",
"šž…ƒ",
"šž…„",
"šž……",
"šž…†",
"šž…‡",
"šž…ˆ",
"šž…‰"
],
"java": [
"꧐",
"ź§‘",
"ź§’",
"ź§“",
"ź§”",
"ź§•",
"ź§–",
"ź§—",
"꧘",
"ź§™"
],
"kali": [
"꤀",
"꤁",
"꤂",
"꤃",
"꤄",
"꤅",
"꤆",
"꤇",
"꤈",
"꤉"
],
"khmr": [
"០",
"។",
"២",
"៣",
"៤",
"ោ",
"៦",
"៧",
"៨",
"៩"
],
"knda": [
"೦",
"ą³§",
"೨",
"೩",
"ą³Ŗ",
"೫",
"೬",
"ą³­",
"ą³®",
"೯"
],
"lana": [
"įŖ€",
"᪁",
"įŖ‚",
"᪃",
"įŖ„",
"įŖ…",
"įŖ†",
"įŖ‡",
"᪈",
"įŖ‰"
],
"lanatham": [
"᪐",
"įŖ‘",
"įŖ’",
"įŖ“",
"įŖ”",
"įŖ•",
"įŖ–",
"įŖ—",
"᪘",
"įŖ™"
],
"laoo": [
"໐",
"໑",
"ą»’",
"໓",
"ą»”",
"໕",
"ą»–",
"ą»—",
"໘",
"ą»™"
],
"lepc": [
"᪐",
"įŖ‘",
"įŖ’",
"įŖ“",
"įŖ”",
"įŖ•",
"įŖ–",
"įŖ—",
"᪘",
"įŖ™"
],
"limb": [
"ᄆ",
"ᄇ",
"ᄈ",
"ᄉ",
"ᄊ",
"į„‹",
"ᄌ",
"į„",
"į„Ž",
"į„"
],
"mathbold": [
"šŸŽ",
"šŸ",
"šŸ",
"šŸ‘",
"šŸ’",
"šŸ“",
"šŸ”",
"šŸ•",
"šŸ–",
"šŸ—"
],
"mathdbl": [
"šŸ˜",
"šŸ™",
"šŸš",
"šŸ›",
"šŸœ",
"šŸ",
"šŸž",
"šŸŸ",
"šŸ ",
"šŸ”"
],
"mathmono": [
"šŸ¶",
"šŸ·",
"šŸø",
"šŸ¹",
"šŸŗ",
"šŸ»",
"šŸ¼",
"šŸ½",
"šŸ¾",
"šŸæ"
],
"mathsanb": [
"šŸ¬",
"šŸ­",
"šŸ®",
"šŸÆ",
"šŸ°",
"šŸ±",
"šŸ²",
"šŸ³",
"šŸ“",
"šŸµ"
],
"mathsans": [
"šŸ¢",
"šŸ£",
"šŸ¤",
"šŸ„",
"šŸ¦",
"šŸ§",
"šŸØ",
"šŸ©",
"šŸŖ",
"šŸ«"
],
"mlym": [
"൦",
"ąµ§",
"൨",
"൩",
"ąµŖ",
"൫",
"൬",
"ąµ­",
"ąµ®",
"൯"
],
"modi": [
"𑙐",
"š‘™‘",
"š‘™’",
"š‘™“",
"š‘™”",
"š‘™•",
"š‘™–",
"š‘™—",
"š‘™˜",
"š‘™™"
],
"mong": [
"᠐",
"į ‘",
"į ’",
"į “",
"į ”",
"į •",
"į –",
"į —",
"᠘",
"į ™"
],
"mroo": [
"š–© ",
"š–©”",
"š–©¢",
"š–©£",
"𖩤",
"š–©„",
"𖩦",
"š–©§",
"š–©Ø",
"š–©©"
],
"mtei": [
"꯰",
"꯱",
"꯲",
"꯳",
"ꯓ",
"꯵",
"꯶",
"꯷",
"꯸",
"꯹"
],
"mymr": [
"၀",
"၁",
"၂",
"၃",
"၄",
"၅",
"၆",
"၇",
"၈",
"၉"
],
"mymrshan": [
"႐",
"į‚‘",
"į‚’",
"į‚“",
"į‚”",
"į‚•",
"į‚–",
"į‚—",
"į‚˜",
"į‚™"
],
"mymrtlng": [
"ź§°",
"ź§±",
"ź§²",
"ź§³",
"ź§“",
"ź§µ",
"ź§¶",
"ź§·",
"ź§ø",
"ź§¹"
],
"newa": [
"𑑐",
"š‘‘‘",
"š‘‘’",
"š‘‘“",
"š‘‘”",
"š‘‘•",
"š‘‘–",
"š‘‘—",
"š‘‘˜",
"š‘‘™"
],
"nkoo": [
"߀",
"߁",
"߂",
"߃",
"߄",
"߅",
"߆",
"߇",
"߈",
"߉"
],
"olck": [
"᱐",
"᱑",
"į±’",
"᱓",
"į±”",
"᱕",
"į±–",
"į±—",
"᱘",
"į±™"
],
"orya": [
"ą­¦",
"ą­§",
"ą­Ø",
"ą­©",
"ą­Ŗ",
"ą­«",
"ą­¬",
"ą­­",
"ą­®",
"ą­Æ"
],
"osma": [
"𐒠",
"𐒔",
"𐒢",
"𐒣",
"𐒤",
"𐒄",
"𐒦",
"𐒧",
"𐒨",
"𐒩"
],
"rohg": [
"𐓰",
"𐓱",
"𐓲",
"𐓳",
"𐓓",
"𐓵",
"𐓶",
"𐓷",
"𐓸",
"𐓹"
],
"saur": [
"꣐",
"꣑",
"꣒",
"꣓",
"꣔",
"꣕",
"꣖",
"꣗",
"꣘",
"꣙"
],
"segment": [
"🯰",
"🯱",
"🯲",
"🯳",
"🯓",
"🯵",
"🯶",
"🯷",
"🯸",
"🯹"
],
"shrd": [
"𑇐",
"𑇑",
"𑇒",
"𑇓",
"𑇔",
"𑇕",
"𑇖",
"𑇗",
"š‘‡˜",
"𑇙"
],
"sind": [
"š‘‹°",
"š‘‹±",
"š‘‹²",
"š‘‹³",
"š‘‹“",
"š‘‹µ",
"š‘‹¶",
"š‘‹·",
"š‘‹ø",
"š‘‹¹"
],
"sinh": [
"ą·¦",
"ą·§",
"ą·Ø",
"ą·©",
"ą·Ŗ",
"ą·«",
"ą·¬",
"ą·­",
"ą·®",
"ą·Æ"
],
"sora": [
"š‘ƒ°",
"š‘ƒ±",
"š‘ƒ²",
"š‘ƒ³",
"š‘ƒ“",
"š‘ƒµ",
"š‘ƒ¶",
"š‘ƒ·",
"š‘ƒø",
"š‘ƒ¹"
],
"sund": [
"į®°",
"į®±",
"᮲",
"᮳",
"ᮓ",
"᮵",
"į®¶",
"į®·",
"᮸",
"᮹"
],
"takr": [
"𑛀",
"𑛁",
"š‘›‚",
"š‘›ƒ",
"š‘›„",
"š‘›…",
"𑛆",
"𑛇",
"š‘›ˆ",
"𑛉"
],
"talu": [
"᧐",
"į§‘",
"į§’",
"į§“",
"į§”",
"į§•",
"į§–",
"į§—",
"᧘",
"į§™"
],
"tamldec": [
"௦",
"௧",
"௨",
"௩",
"௪",
"௫",
"௬",
"௭",
"௮",
"௯"
],
"telu": [
"౦",
"ą±§",
"౨",
"౩",
"ą±Ŗ",
"౫",
"౬",
"ą±­",
"ą±®",
"౯"
],
"thai": [
"๐",
"๑",
"ą¹’",
"๓",
"ą¹”",
"๕",
"ą¹–",
"ą¹—",
"๘",
"ą¹™"
],
"tibt": [
"ą¼ ",
"ą¼”",
"ą¼¢",
"ą¼£",
"༤",
"༄",
"༦",
"ą¼§",
"༨",
"༩"
],
"tirh": [
"𑓐",
"š‘“‘",
"š‘“’",
"š‘““",
"š‘“”",
"š‘“•",
"š‘“–",
"š‘“—",
"š‘“˜",
"š‘“™"
],
"vaii": [
"ᘠ",
"ᘔ",
"ᘢ",
"ᘣ",
"ᘤ",
"ᘄ",
"ᘦ",
"ᘧ",
"ᘨ",
"ᘩ"
],
"wara": [
"š‘£ ",
"š‘£”",
"š‘£¢",
"š‘££",
"𑣤",
"𑣄",
"𑣦",
"š‘£§",
"𑣨",
"𑣩"
],
"wcho": [
"šž‹°",
"šž‹±",
"šž‹²",
"šž‹³",
"šž‹“",
"šž‹µ",
"šž‹¶",
"šž‹·",
"šž‹ø",
"šž‹¹"
]
adlm: ['šž„', 'šž„‘', 'šž„’', 'šž„“', 'šž„”', 'šž„•', 'šž„–', 'šž„—', 'šž„˜', 'šž„™'],
ahom: ['š‘œ°', 'š‘œ±', 'š‘œ²', 'š‘œ³', 'š‘œ“', 'š‘œµ', 'š‘œ¶', 'š‘œ·', 'š‘œø', 'š‘œ¹'],
arab: ['٠', 'ٔ', '٢', '٣', '٤', 'ل', '٦', '٧', '٨', '٩'],
arabext: ['Ū°', 'Ū±', 'Ū²', 'Ū³', 'Ū“', 'Ūµ', 'Ū¶', 'Ū·', 'Ūø', 'Ū¹'],
bali: ['᭐', 'į­‘', 'į­’', 'į­“', 'į­”', 'į­•', 'į­–', 'į­—', '᭘', 'į­™'],
beng: ['০', '১', '২', '৩', '৪', '৫', '৬', '৭', '৮', '৯'],
bhks: ['𑱐', '𑱑', '𑱒', '𑱓', '𑱔', '𑱕', '𑱖', '𑱗', 'š‘±˜', '𑱙'],
brah: ['𑁦', '𑁧', '𑁨', '𑁩', '𑁪', '𑁫', '𑁬', '𑁭', '𑁮', '𑁯'],
cakm: ['š‘„¶', 'š‘„·', 'š‘„ø', 'š‘„¹', 'š‘„ŗ', 'š‘„»', 'š‘„¼', 'š‘„½', 'š‘„¾', 'š‘„æ'],
cham: ['꩐', 'ź©‘', 'ź©’', 'ź©“', 'ź©”', 'ź©•', 'ź©–', 'ź©—', '꩘', 'ź©™'],
deva: ['ą„¦', 'ą„§', 'ą„Ø', 'ą„©', 'ą„Ŗ', 'ą„«', 'ą„¬', 'ą„­', 'ą„®', 'ą„Æ'],
diak: ['𑄐', 'š‘„‘', 'š‘„’', 'š‘„“', 'š‘„”', 'š‘„•', 'š‘„–', 'š‘„—', 'š‘„˜', 'š‘„™'],
fullwide: ['0', '1', 'ļ¼’', '3', 'ļ¼”', '5', 'ļ¼–', 'ļ¼—', '8', 'ļ¼™'],
gong: ['š‘¶ ', 'š‘¶”', 'š‘¶¢', 'š‘¶£', '𑶤', 'š‘¶„', '𑶦', 'š‘¶§', 'š‘¶Ø', 'š‘¶©'],
gonm: ['𑵐', '𑵑', '𑵒', '𑵓', '𑵔', '𑵕', '𑵖', '𑵗', 'š‘µ˜', '𑵙'],
gujr: ['૦', '૧', '૨', '૩', '૪', '૫', '૬', '૭', '૮', '૯'],
guru: ['੦', '੧', '੨', '੩', '੪', '੫', '੬', '੭', '੮', '੯'],
hanidec: ['怇', 'äø€', '二', 'äø‰', '四', 'äŗ”', '六', '七', '八', '九'],
hmng: ['𖭐', 'š–­‘', 'š–­’', 'š–­“', 'š–­”', 'š–­•', 'š–­–', 'š–­—', 'š–­˜', 'š–­™'],
hmnp: ['šž…€', 'šž…', 'šž…‚', 'šž…ƒ', 'šž…„', 'šž……', 'šž…†', 'šž…‡', 'šž…ˆ', 'šž…‰'],
java: ['꧐', 'ź§‘', 'ź§’', 'ź§“', 'ź§”', 'ź§•', 'ź§–', 'ź§—', '꧘', 'ź§™'],
kali: ['꤀', '꤁', '꤂', '꤃', '꤄', '꤅', '꤆', '꤇', '꤈', '꤉'],
khmr: ['០', '។', '២', '៣', '៤', 'ោ', '៦', '៧', '៨', '៩'],
knda: ['೦', '೧', '೨', '೩', '೪', '೫', '೬', '೭', '೮', '೯'],
lana: ['įŖ€', '᪁', 'įŖ‚', '᪃', 'įŖ„', 'įŖ…', 'įŖ†', 'įŖ‡', '᪈', 'įŖ‰'],
lanatham: ['᪐', 'įŖ‘', 'įŖ’', 'įŖ“', 'įŖ”', 'įŖ•', 'įŖ–', 'įŖ—', '᪘', 'įŖ™'],
laoo: ['໐', '໑', 'ą»’', '໓', 'ą»”', '໕', 'ą»–', 'ą»—', '໘', 'ą»™'],
lepc: ['᪐', 'įŖ‘', 'įŖ’', 'įŖ“', 'įŖ”', 'įŖ•', 'įŖ–', 'įŖ—', '᪘', 'įŖ™'],
limb: ['ᄆ', 'ᄇ', 'ᄈ', 'ᄉ', 'ᄊ', 'į„‹', 'ᄌ', 'į„', 'į„Ž', 'į„'],
mathbold: ['šŸŽ', 'šŸ', 'šŸ', 'šŸ‘', 'šŸ’', 'šŸ“', 'šŸ”', 'šŸ•', 'šŸ–', 'šŸ—'],
mathdbl: ['šŸ˜', 'šŸ™', 'šŸš', 'šŸ›', 'šŸœ', 'šŸ', 'šŸž', 'šŸŸ', 'šŸ ', 'šŸ”'],
mathmono: ['šŸ¶', 'šŸ·', 'šŸø', 'šŸ¹', 'šŸŗ', 'šŸ»', 'šŸ¼', 'šŸ½', 'šŸ¾', 'šŸæ'],
mathsanb: ['šŸ¬', 'šŸ­', 'šŸ®', 'šŸÆ', 'šŸ°', 'šŸ±', 'šŸ²', 'šŸ³', 'šŸ“', 'šŸµ'],
mathsans: ['šŸ¢', 'šŸ£', 'šŸ¤', 'šŸ„', 'šŸ¦', 'šŸ§', 'šŸØ', 'šŸ©', 'šŸŖ', 'šŸ«'],
mlym: ['൦', '൧', '൨', '൩', '൪', '൫', '൬', '൭', '൮', '൯'],
modi: ['𑙐', 'š‘™‘', 'š‘™’', 'š‘™“', 'š‘™”', 'š‘™•', 'š‘™–', 'š‘™—', 'š‘™˜', 'š‘™™'],
mong: ['᠐', 'į ‘', 'į ’', 'į “', 'į ”', 'į •', 'į –', 'į —', '᠘', 'į ™'],
mroo: ['š–© ', 'š–©”', 'š–©¢', 'š–©£', '𖩤', 'š–©„', '𖩦', 'š–©§', 'š–©Ø', 'š–©©'],
mtei: ['꯰', '꯱', '꯲', '꯳', 'ꯓ', '꯵', '꯶', '꯷', '꯸', '꯹'],
mymr: ['၀', '၁', '၂', '၃', '၄', '၅', '၆', '၇', '၈', '၉'],
mymrshan: ['႐', 'į‚‘', 'į‚’', 'į‚“', 'į‚”', 'į‚•', 'į‚–', 'į‚—', 'į‚˜', 'į‚™'],
mymrtlng: ['ź§°', 'ź§±', 'ź§²', 'ź§³', 'ź§“', 'ź§µ', 'ź§¶', 'ź§·', 'ź§ø', 'ź§¹'],
newa: ['𑑐', 'š‘‘‘', 'š‘‘’', 'š‘‘“', 'š‘‘”', 'š‘‘•', 'š‘‘–', 'š‘‘—', 'š‘‘˜', 'š‘‘™'],
nkoo: ['߀', '߁', '߂', '߃', '߄', '߅', '߆', '߇', '߈', '߉'],
olck: ['᱐', '᱑', 'į±’', '᱓', 'į±”', '᱕', 'į±–', 'į±—', '᱘', 'į±™'],
orya: ['ą­¦', 'ą­§', 'ą­Ø', 'ą­©', 'ą­Ŗ', 'ą­«', 'ą­¬', 'ą­­', 'ą­®', 'ą­Æ'],
osma: ['𐒠', '𐒔', '𐒢', '𐒣', '𐒤', '𐒄', '𐒦', '𐒧', '𐒨', '𐒩'],
rohg: ['𐓰', '𐓱', '𐓲', '𐓳', '𐓓', '𐓵', '𐓶', '𐓷', '𐓸', '𐓹'],
saur: ['꣐', '꣑', '꣒', '꣓', '꣔', '꣕', '꣖', '꣗', '꣘', '꣙'],
segment: ['🯰', '🯱', '🯲', '🯳', '🯓', '🯵', '🯶', '🯷', '🯸', '🯹'],
shrd: ['𑇐', '𑇑', '𑇒', '𑇓', '𑇔', '𑇕', '𑇖', '𑇗', 'š‘‡˜', '𑇙'],
sind: ['š‘‹°', 'š‘‹±', 'š‘‹²', 'š‘‹³', 'š‘‹“', 'š‘‹µ', 'š‘‹¶', 'š‘‹·', 'š‘‹ø', 'š‘‹¹'],
sinh: ['ą·¦', 'ą·§', 'ą·Ø', 'ą·©', 'ą·Ŗ', 'ą·«', 'ą·¬', 'ą·­', 'ą·®', 'ą·Æ'],
sora: ['š‘ƒ°', 'š‘ƒ±', 'š‘ƒ²', 'š‘ƒ³', 'š‘ƒ“', 'š‘ƒµ', 'š‘ƒ¶', 'š‘ƒ·', 'š‘ƒø', 'š‘ƒ¹'],
sund: ['᮰', '᮱', '᮲', '᮳', 'ᮓ', '᮵', '᮶', '᮷', '᮸', '᮹'],
takr: ['𑛀', '𑛁', 'š‘›‚', 'š‘›ƒ', 'š‘›„', 'š‘›…', '𑛆', '𑛇', 'š‘›ˆ', '𑛉'],
talu: ['᧐', 'į§‘', 'į§’', 'į§“', 'į§”', 'į§•', 'į§–', 'į§—', '᧘', 'į§™'],
tamldec: ['௦', '௧', '௨', '௩', '௪', '௫', '௬', '௭', '௮', '௯'],
telu: ['౦', '౧', '౨', '౩', '౪', '౫', '౬', '౭', '౮', '౯'],
thai: ['๐', '๑', 'ą¹’', '๓', 'ą¹”', '๕', 'ą¹–', 'ą¹—', '๘', 'ą¹™'],
tibt: ['༠', '༔', '༢', '༣', '༤', '༄', '༦', '༧', '༨', '༩'],
tirh: ['𑓐', 'š‘“‘', 'š‘“’', 'š‘““', 'š‘“”', 'š‘“•', 'š‘“–', 'š‘“—', 'š‘“˜', 'š‘“™'],
vaii: ['ᘠ', 'ᘔ', 'ᘢ', 'ᘣ', 'ᘤ', 'ᘄ', 'ᘦ', 'ᘧ', 'ᘨ', 'ᘩ'],
wara: ['š‘£ ', 'š‘£”', 'š‘£¢', 'š‘££', '𑣤', '𑣄', '𑣦', 'š‘£§', '𑣨', '𑣩'],
wcho: ['šž‹°', 'šž‹±', 'šž‹²', 'šž‹³', 'šž‹“', 'šž‹µ', 'šž‹¶', 'šž‹·', 'šž‹ø', 'šž‹¹'],
};

@@ -401,3 +401,3 @@ import { Decimal } from 'decimal.js';

function getCompactDisplayPattern(numberResult, pl, data, style, compactDisplay, currencyDisplay, numberingSystem) {
var _a;
var _a, _b;
var roundedNumber = numberResult.roundedNumber, sign = numberResult.sign, magnitude = numberResult.magnitude;

@@ -413,3 +413,12 @@ var magnitudeKey = String(Math.pow(10, magnitude));

var compactPluralRules = (_a = currencyData.short) === null || _a === void 0 ? void 0 : _a[magnitudeKey];
// GH #4236: If magnitude exceeds available patterns, use the largest available
if (!compactPluralRules) {
var thresholds = Object.keys(currencyData.short || {});
if (thresholds.length > 0 &&
magnitudeKey > thresholds[thresholds.length - 1]) {
magnitudeKey = thresholds[thresholds.length - 1];
compactPluralRules = (_b = currencyData.short) === null || _b === void 0 ? void 0 : _b[magnitudeKey];
}
}
if (!compactPluralRules) {
return null;

@@ -424,3 +433,12 @@ }

var compactPlaralRule = byCompactDisplay[compactDisplay][magnitudeKey];
// GH #4236: If magnitude exceeds available patterns, use the largest available
if (!compactPlaralRule) {
var thresholds = Object.keys(byCompactDisplay[compactDisplay]);
if (thresholds.length > 0 &&
magnitudeKey > thresholds[thresholds.length - 1]) {
magnitudeKey = thresholds[thresholds.length - 1];
compactPlaralRule = byCompactDisplay[compactDisplay][magnitudeKey];
}
}
if (!compactPlaralRule) {
return null;

@@ -427,0 +445,0 @@ }

{
"name": "@formatjs/ecma402-abstract",
"description": "A collection of implementation for ECMAScript abstract operations",
"version": "3.0.6",
"version": "3.0.7",
"license": "MIT",

@@ -16,4 +16,4 @@ "author": "Long Ho <holevietlong@gmail.com",

"tslib": "^2.8.0",
"@formatjs/fast-memoize": "3.0.1",
"@formatjs/intl-localematcher": "0.7.3"
"@formatjs/intl-localematcher": "0.7.4",
"@formatjs/fast-memoize": "3.0.2"
},

@@ -20,0 +20,0 @@ "bugs": "https://github.com/formatjs/formatjs/issues",