decord/source/13404___exportStarResult27.js

51 lines
2.3 KiB
JavaScript
Raw Normal View History

2026-08-05 07:35:12 +00:00
// Module ID: 13404
// Function ID: 13405
2026-07-23 10:11:24 +00:00
// Name: __exportStarResult27
2026-08-05 07:35:12 +00:00
// Dependencies: [13363, 13358, 13368, 13369]
2026-07-23 10:11:24 +00:00
2026-08-05 07:35:12 +00:00
// Module 13404 (__exportStarResult27)
2026-07-23 10:11:24 +00:00
const require = arg1;
const dependencyMap = arg6;
arg5.SetNumberFormatUnitOptions = function SetNumberFormatUnitOptions(internalSlots, result1) {
let obj = result1;
if (undefined === result1) {
const _Object = Object;
obj = Object.create(null);
}
2026-08-05 07:35:12 +00:00
const GetOptionResult = require(13363) /* __exportStarResult4 */.GetOption(obj, "style", "string", ["decimal", "percent", "currency", "unit"], "decimal");
2026-07-23 10:11:24 +00:00
internalSlots.style = GetOptionResult;
2026-08-05 07:35:12 +00:00
const str = require(13363) /* __exportStarResult4 */.GetOption(obj, "currency", "string", undefined, undefined);
2026-07-23 10:11:24 +00:00
let result = undefined === str;
if (!result) {
2026-08-05 07:35:12 +00:00
result = tmp4(13368).IsWellFormedCurrencyCode(str);
2026-07-23 10:11:24 +00:00
}
2026-08-05 07:35:12 +00:00
require(13358) /* getMultiInternalSlots */.invariant(result, "Malformed currency code", RangeError);
2026-07-23 10:11:24 +00:00
let tmp10 = "currency" !== GetOptionResult;
if (!tmp10) {
tmp10 = undefined !== str;
}
2026-08-05 07:35:12 +00:00
require(13358) /* getMultiInternalSlots */.invariant(tmp10, "currency cannot be undefined", TypeError);
const GetOptionResult1 = require(13363) /* __exportStarResult4 */.GetOption(obj, "currencyDisplay", "string", ["code", "symbol", "narrowSymbol", "name"], "symbol");
const GetOptionResult3 = require(13363) /* __exportStarResult4 */.GetOption(obj, "unit", "string", undefined, undefined);
2026-07-23 10:11:24 +00:00
result1 = undefined === GetOptionResult3;
if (!result1) {
2026-08-05 07:35:12 +00:00
result1 = tmp4(13369).IsWellFormedUnitIdentifier(GetOptionResult3);
2026-07-23 10:11:24 +00:00
}
2026-08-05 07:35:12 +00:00
require(13358) /* getMultiInternalSlots */.invariant(result1, "Invalid unit argument for Intl.NumberFormat()", RangeError);
2026-07-29 08:29:29 +00:00
let tmp17 = "unit" !== GetOptionResult;
if (!tmp17) {
tmp17 = undefined !== GetOptionResult3;
2026-07-23 10:11:24 +00:00
}
2026-08-05 07:35:12 +00:00
require(13358) /* getMultiInternalSlots */.invariant(tmp17, "unit cannot be undefined", TypeError);
const GetOptionResult2 = require(13363) /* __exportStarResult4 */.GetOption(obj, "currencySign", "string", ["standard", "accounting"], "standard");
2026-07-23 10:11:24 +00:00
if ("currency" === GetOptionResult) {
internalSlots.currency = str.toUpperCase();
internalSlots.currencyDisplay = GetOptionResult1;
internalSlots.currencySign = GetOptionResult2;
}
if ("unit" === GetOptionResult) {
internalSlots.unit = GetOptionResult3;
internalSlots.unitDisplay = GetOptionResult4;
}
};