@formatjs/ecma402-abstract 1.11.6 → 1.11.9
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/262.ts +372 -0
- package/BUILD +97 -0
- package/CHANGELOG.md +709 -0
- package/CanonicalizeLocaleList.ts +8 -0
- package/CanonicalizeTimeZoneName.ts +29 -0
- package/CoerceOptionsToObject.ts +13 -0
- package/DefaultNumberOption.ts +28 -0
- package/GetNumberOption.ts +29 -0
- package/GetOption.ts +38 -0
- package/GetOptionsObject.ts +14 -0
- package/IsSanctionedSimpleUnitIdentifier.ts +66 -0
- package/IsValidTimeZoneName.ts +27 -0
- package/IsWellFormedCurrencyCode.ts +23 -0
- package/IsWellFormedUnitIdentifier.ts +32 -0
- package/LICENSE.md +0 -0
- package/NumberFormat/ComputeExponent.ts +49 -0
- package/NumberFormat/ComputeExponentForMagnitude.ts +71 -0
- package/NumberFormat/CurrencyDigits.ts +13 -0
- package/NumberFormat/FormatNumericToParts.ts +22 -0
- package/NumberFormat/FormatNumericToString.ts +71 -0
- package/NumberFormat/InitializeNumberFormat.ts +147 -0
- package/NumberFormat/PartitionNumberPattern.ts +86 -0
- package/NumberFormat/SetNumberFormatDigitOptions.ts +45 -0
- package/NumberFormat/SetNumberFormatUnitOptions.ts +77 -0
- package/NumberFormat/ToRawFixed.ts +56 -0
- package/NumberFormat/ToRawPrecision.ts +86 -0
- package/NumberFormat/digit-mapping.generated.ts +1 -0
- package/NumberFormat/format_to_parts.ts +571 -0
- package/PartitionPattern.ts +38 -0
- package/README.md +0 -0
- package/SupportedLocales.ts +31 -0
- package/data.ts +9 -0
- package/index.ts +45 -0
- package/package.json +3 -3
- package/regex.generated.ts +2 -0
- package/scripts/digit-mapping.ts +109 -0
- package/scripts/regex-gen.ts +19 -0
- package/tests/PartitionPattern.test.ts +38 -0
- package/tests/ToRawFixed.test.tsx +41 -0
- package/tests/ToRawPrecision.test.tsx +65 -0
- package/tsconfig.json +5 -0
- package/types/core.ts +11 -0
- package/types/date-time.ts +199 -0
- package/types/displaynames.ts +48 -0
- package/types/list.ts +22 -0
- package/types/number.ts +240 -0
- package/types/plural-rules.ts +18 -0
- package/types/relative-time.ts +74 -0
- package/utils.ts +128 -0
- package/262.d.ts +0 -92
- package/262.d.ts.map +0 -1
- package/262.js +0 -362
- package/CanonicalizeLocaleList.d.ts +0 -6
- package/CanonicalizeLocaleList.d.ts.map +0 -1
- package/CanonicalizeLocaleList.js +0 -12
- package/CanonicalizeTimeZoneName.d.ts +0 -9
- package/CanonicalizeTimeZoneName.d.ts.map +0 -1
- package/CanonicalizeTimeZoneName.js +0 -21
- package/CoerceOptionsToObject.d.ts +0 -7
- package/CoerceOptionsToObject.d.ts.map +0 -1
- package/CoerceOptionsToObject.js +0 -16
- package/DefaultNumberOption.d.ts +0 -9
- package/DefaultNumberOption.d.ts.map +0 -1
- package/DefaultNumberOption.js +0 -14
- package/GetNumberOption.d.ts +0 -10
- package/GetNumberOption.d.ts.map +0 -1
- package/GetNumberOption.js +0 -18
- package/GetOption.d.ts +0 -10
- package/GetOption.d.ts.map +0 -1
- package/GetOption.js +0 -35
- package/GetOptionsObject.d.ts +0 -7
- package/GetOptionsObject.d.ts.map +0 -1
- package/GetOptionsObject.js +0 -18
- package/IsSanctionedSimpleUnitIdentifier.d.ts +0 -14
- package/IsSanctionedSimpleUnitIdentifier.d.ts.map +0 -1
- package/IsSanctionedSimpleUnitIdentifier.js +0 -68
- package/IsValidTimeZoneName.d.ts +0 -10
- package/IsValidTimeZoneName.d.ts.map +0 -1
- package/IsValidTimeZoneName.js +0 -23
- package/IsWellFormedCurrencyCode.d.ts +0 -5
- package/IsWellFormedCurrencyCode.d.ts.map +0 -1
- package/IsWellFormedCurrencyCode.js +0 -25
- package/IsWellFormedUnitIdentifier.d.ts +0 -6
- package/IsWellFormedUnitIdentifier.d.ts.map +0 -1
- package/IsWellFormedUnitIdentifier.js +0 -32
- package/NumberFormat/ComputeExponent.d.ts +0 -12
- package/NumberFormat/ComputeExponent.d.ts.map +0 -1
- package/NumberFormat/ComputeExponent.js +0 -43
- package/NumberFormat/ComputeExponentForMagnitude.d.ts +0 -10
- package/NumberFormat/ComputeExponentForMagnitude.d.ts.map +0 -1
- package/NumberFormat/ComputeExponentForMagnitude.js +0 -64
- package/NumberFormat/CurrencyDigits.d.ts +0 -7
- package/NumberFormat/CurrencyDigits.d.ts.map +0 -1
- package/NumberFormat/CurrencyDigits.js +0 -14
- package/NumberFormat/FormatNumericToParts.d.ts +0 -5
- package/NumberFormat/FormatNumericToParts.d.ts.map +0 -1
- package/NumberFormat/FormatNumericToParts.js +0 -18
- package/NumberFormat/FormatNumericToString.d.ts +0 -9
- package/NumberFormat/FormatNumericToString.d.ts.map +0 -1
- package/NumberFormat/FormatNumericToString.js +0 -45
- package/NumberFormat/InitializeNumberFormat.d.ts +0 -13
- package/NumberFormat/InitializeNumberFormat.d.ts.map +0 -1
- package/NumberFormat/InitializeNumberFormat.js +0 -68
- package/NumberFormat/PartitionNumberPattern.d.ts +0 -8
- package/NumberFormat/PartitionNumberPattern.d.ts.map +0 -1
- package/NumberFormat/PartitionNumberPattern.js +0 -80
- package/NumberFormat/SetNumberFormatDigitOptions.d.ts +0 -6
- package/NumberFormat/SetNumberFormatDigitOptions.d.ts.map +0 -1
- package/NumberFormat/SetNumberFormatDigitOptions.js +0 -40
- package/NumberFormat/SetNumberFormatUnitOptions.d.ts +0 -8
- package/NumberFormat/SetNumberFormatUnitOptions.d.ts.map +0 -1
- package/NumberFormat/SetNumberFormatUnitOptions.js +0 -43
- package/NumberFormat/ToRawFixed.d.ts +0 -10
- package/NumberFormat/ToRawFixed.d.ts.map +0 -1
- package/NumberFormat/ToRawFixed.js +0 -55
- package/NumberFormat/ToRawPrecision.d.ts +0 -3
- package/NumberFormat/ToRawPrecision.d.ts.map +0 -1
- package/NumberFormat/ToRawPrecision.js +0 -78
- package/NumberFormat/digit-mapping.generated.d.ts +0 -2
- package/NumberFormat/digit-mapping.generated.d.ts.map +0 -1
- package/NumberFormat/digit-mapping.generated.js +0 -4
- package/NumberFormat/format_to_parts.d.ts +0 -22
- package/NumberFormat/format_to_parts.d.ts.map +0 -1
- package/NumberFormat/format_to_parts.js +0 -424
- package/PartitionPattern.d.ts +0 -9
- package/PartitionPattern.d.ts.map +0 -1
- package/PartitionPattern.js +0 -39
- package/SupportedLocales.d.ts +0 -10
- package/SupportedLocales.d.ts.map +0 -1
- package/SupportedLocales.js +0 -24
- package/data.d.ts +0 -6
- package/data.d.ts.map +0 -1
- package/data.js +0 -17
- package/index.d.ts +0 -37
- package/index.d.ts.map +0 -1
- package/index.js +0 -48
- package/lib/262.d.ts +0 -92
- package/lib/262.d.ts.map +0 -1
- package/lib/262.js +0 -336
- package/lib/CanonicalizeLocaleList.d.ts +0 -6
- package/lib/CanonicalizeLocaleList.d.ts.map +0 -1
- package/lib/CanonicalizeLocaleList.js +0 -8
- package/lib/CanonicalizeTimeZoneName.d.ts +0 -9
- package/lib/CanonicalizeTimeZoneName.d.ts.map +0 -1
- package/lib/CanonicalizeTimeZoneName.js +0 -17
- package/lib/CoerceOptionsToObject.d.ts +0 -7
- package/lib/CoerceOptionsToObject.d.ts.map +0 -1
- package/lib/CoerceOptionsToObject.js +0 -12
- package/lib/DefaultNumberOption.d.ts +0 -9
- package/lib/DefaultNumberOption.d.ts.map +0 -1
- package/lib/DefaultNumberOption.js +0 -10
- package/lib/GetNumberOption.d.ts +0 -10
- package/lib/GetNumberOption.d.ts.map +0 -1
- package/lib/GetNumberOption.js +0 -14
- package/lib/GetOption.d.ts +0 -10
- package/lib/GetOption.d.ts.map +0 -1
- package/lib/GetOption.js +0 -31
- package/lib/GetOptionsObject.d.ts +0 -7
- package/lib/GetOptionsObject.d.ts.map +0 -1
- package/lib/GetOptionsObject.js +0 -14
- package/lib/IsSanctionedSimpleUnitIdentifier.d.ts +0 -14
- package/lib/IsSanctionedSimpleUnitIdentifier.d.ts.map +0 -1
- package/lib/IsSanctionedSimpleUnitIdentifier.js +0 -63
- package/lib/IsValidTimeZoneName.d.ts +0 -10
- package/lib/IsValidTimeZoneName.d.ts.map +0 -1
- package/lib/IsValidTimeZoneName.js +0 -19
- package/lib/IsWellFormedCurrencyCode.d.ts +0 -5
- package/lib/IsWellFormedCurrencyCode.d.ts.map +0 -1
- package/lib/IsWellFormedCurrencyCode.js +0 -21
- package/lib/IsWellFormedUnitIdentifier.d.ts +0 -6
- package/lib/IsWellFormedUnitIdentifier.d.ts.map +0 -1
- package/lib/IsWellFormedUnitIdentifier.js +0 -28
- package/lib/NumberFormat/ComputeExponent.d.ts +0 -12
- package/lib/NumberFormat/ComputeExponent.d.ts.map +0 -1
- package/lib/NumberFormat/ComputeExponent.js +0 -39
- package/lib/NumberFormat/ComputeExponentForMagnitude.d.ts +0 -10
- package/lib/NumberFormat/ComputeExponentForMagnitude.d.ts.map +0 -1
- package/lib/NumberFormat/ComputeExponentForMagnitude.js +0 -60
- package/lib/NumberFormat/CurrencyDigits.d.ts +0 -7
- package/lib/NumberFormat/CurrencyDigits.d.ts.map +0 -1
- package/lib/NumberFormat/CurrencyDigits.js +0 -10
- package/lib/NumberFormat/FormatNumericToParts.d.ts +0 -5
- package/lib/NumberFormat/FormatNumericToParts.d.ts.map +0 -1
- package/lib/NumberFormat/FormatNumericToParts.js +0 -14
- package/lib/NumberFormat/FormatNumericToString.d.ts +0 -9
- package/lib/NumberFormat/FormatNumericToString.d.ts.map +0 -1
- package/lib/NumberFormat/FormatNumericToString.js +0 -41
- package/lib/NumberFormat/InitializeNumberFormat.d.ts +0 -13
- package/lib/NumberFormat/InitializeNumberFormat.d.ts.map +0 -1
- package/lib/NumberFormat/InitializeNumberFormat.js +0 -64
- package/lib/NumberFormat/PartitionNumberPattern.d.ts +0 -8
- package/lib/NumberFormat/PartitionNumberPattern.d.ts.map +0 -1
- package/lib/NumberFormat/PartitionNumberPattern.js +0 -75
- package/lib/NumberFormat/SetNumberFormatDigitOptions.d.ts +0 -6
- package/lib/NumberFormat/SetNumberFormatDigitOptions.d.ts.map +0 -1
- package/lib/NumberFormat/SetNumberFormatDigitOptions.js +0 -36
- package/lib/NumberFormat/SetNumberFormatUnitOptions.d.ts +0 -8
- package/lib/NumberFormat/SetNumberFormatUnitOptions.d.ts.map +0 -1
- package/lib/NumberFormat/SetNumberFormatUnitOptions.js +0 -39
- package/lib/NumberFormat/ToRawFixed.d.ts +0 -10
- package/lib/NumberFormat/ToRawFixed.d.ts.map +0 -1
- package/lib/NumberFormat/ToRawFixed.js +0 -51
- package/lib/NumberFormat/ToRawPrecision.d.ts +0 -3
- package/lib/NumberFormat/ToRawPrecision.d.ts.map +0 -1
- package/lib/NumberFormat/ToRawPrecision.js +0 -74
- package/lib/NumberFormat/digit-mapping.generated.d.ts +0 -2
- package/lib/NumberFormat/digit-mapping.generated.d.ts.map +0 -1
- package/lib/NumberFormat/digit-mapping.generated.js +0 -1
- package/lib/NumberFormat/format_to_parts.d.ts +0 -22
- package/lib/NumberFormat/format_to_parts.d.ts.map +0 -1
- package/lib/NumberFormat/format_to_parts.js +0 -421
- package/lib/PartitionPattern.d.ts +0 -9
- package/lib/PartitionPattern.d.ts.map +0 -1
- package/lib/PartitionPattern.js +0 -35
- package/lib/SupportedLocales.d.ts +0 -10
- package/lib/SupportedLocales.d.ts.map +0 -1
- package/lib/SupportedLocales.js +0 -20
- package/lib/data.d.ts +0 -6
- package/lib/data.d.ts.map +0 -1
- package/lib/data.js +0 -13
- package/lib/index.d.ts +0 -37
- package/lib/index.d.ts.map +0 -1
- package/lib/index.js +0 -34
- package/lib/regex.generated.d.ts +0 -2
- package/lib/regex.generated.d.ts.map +0 -1
- package/lib/regex.generated.js +0 -2
- package/lib/types/core.d.ts +0 -11
- package/lib/types/core.d.ts.map +0 -1
- package/lib/types/core.js +0 -1
- package/lib/types/date-time.d.ts +0 -135
- package/lib/types/date-time.d.ts.map +0 -1
- package/lib/types/date-time.js +0 -6
- package/lib/types/displaynames.d.ts +0 -47
- package/lib/types/displaynames.d.ts.map +0 -1
- package/lib/types/displaynames.js +0 -1
- package/lib/types/list.d.ts +0 -19
- package/lib/types/list.d.ts.map +0 -1
- package/lib/types/list.js +0 -1
- package/lib/types/number.d.ts +0 -147
- package/lib/types/number.d.ts.map +0 -1
- package/lib/types/number.js +0 -1
- package/lib/types/plural-rules.d.ts +0 -17
- package/lib/types/plural-rules.d.ts.map +0 -1
- package/lib/types/plural-rules.js +0 -1
- package/lib/types/relative-time.d.ts +0 -41
- package/lib/types/relative-time.d.ts.map +0 -1
- package/lib/types/relative-time.js +0 -1
- package/lib/utils.d.ts +0 -24
- package/lib/utils.d.ts.map +0 -1
- package/lib/utils.js +0 -78
- package/regex.generated.d.ts +0 -2
- package/regex.generated.d.ts.map +0 -1
- package/regex.generated.js +0 -5
- package/types/core.d.ts +0 -11
- package/types/core.d.ts.map +0 -1
- package/types/core.js +0 -2
- package/types/date-time.d.ts +0 -135
- package/types/date-time.d.ts.map +0 -1
- package/types/date-time.js +0 -9
- package/types/displaynames.d.ts +0 -47
- package/types/displaynames.d.ts.map +0 -1
- package/types/displaynames.js +0 -2
- package/types/list.d.ts +0 -19
- package/types/list.d.ts.map +0 -1
- package/types/list.js +0 -2
- package/types/number.d.ts +0 -147
- package/types/number.d.ts.map +0 -1
- package/types/number.js +0 -2
- package/types/plural-rules.d.ts +0 -17
- package/types/plural-rules.d.ts.map +0 -1
- package/types/plural-rules.js +0 -2
- package/types/relative-time.d.ts +0 -41
- package/types/relative-time.d.ts.map +0 -1
- package/types/relative-time.js +0 -2
- package/utils.d.ts +0 -24
- package/utils.d.ts.map +0 -1
- package/utils.js +0 -90
package/262.js
DELETED
|
@@ -1,362 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.msFromTime = exports.OrdinaryHasInstance = exports.SecFromTime = exports.MinFromTime = exports.HourFromTime = exports.DateFromTime = exports.MonthFromTime = exports.InLeapYear = exports.DayWithinYear = exports.DaysInYear = exports.YearFromTime = exports.TimeFromYear = exports.DayFromYear = exports.WeekDay = exports.Day = exports.Type = exports.HasOwnProperty = exports.ArrayCreate = exports.SameValue = exports.ToObject = exports.TimeClip = exports.ToNumber = exports.ToString = void 0;
|
|
4
|
-
/**
|
|
5
|
-
* https://tc39.es/ecma262/#sec-tostring
|
|
6
|
-
*/
|
|
7
|
-
function ToString(o) {
|
|
8
|
-
// Only symbol is irregular...
|
|
9
|
-
if (typeof o === 'symbol') {
|
|
10
|
-
throw TypeError('Cannot convert a Symbol value to a string');
|
|
11
|
-
}
|
|
12
|
-
return String(o);
|
|
13
|
-
}
|
|
14
|
-
exports.ToString = ToString;
|
|
15
|
-
/**
|
|
16
|
-
* https://tc39.es/ecma262/#sec-tonumber
|
|
17
|
-
* @param val
|
|
18
|
-
*/
|
|
19
|
-
function ToNumber(val) {
|
|
20
|
-
if (val === undefined) {
|
|
21
|
-
return NaN;
|
|
22
|
-
}
|
|
23
|
-
if (val === null) {
|
|
24
|
-
return +0;
|
|
25
|
-
}
|
|
26
|
-
if (typeof val === 'boolean') {
|
|
27
|
-
return val ? 1 : +0;
|
|
28
|
-
}
|
|
29
|
-
if (typeof val === 'number') {
|
|
30
|
-
return val;
|
|
31
|
-
}
|
|
32
|
-
if (typeof val === 'symbol' || typeof val === 'bigint') {
|
|
33
|
-
throw new TypeError('Cannot convert symbol/bigint to number');
|
|
34
|
-
}
|
|
35
|
-
return Number(val);
|
|
36
|
-
}
|
|
37
|
-
exports.ToNumber = ToNumber;
|
|
38
|
-
/**
|
|
39
|
-
* https://tc39.es/ecma262/#sec-tointeger
|
|
40
|
-
* @param n
|
|
41
|
-
*/
|
|
42
|
-
function ToInteger(n) {
|
|
43
|
-
var number = ToNumber(n);
|
|
44
|
-
if (isNaN(number) || SameValue(number, -0)) {
|
|
45
|
-
return 0;
|
|
46
|
-
}
|
|
47
|
-
if (isFinite(number)) {
|
|
48
|
-
return number;
|
|
49
|
-
}
|
|
50
|
-
var integer = Math.floor(Math.abs(number));
|
|
51
|
-
if (number < 0) {
|
|
52
|
-
integer = -integer;
|
|
53
|
-
}
|
|
54
|
-
if (SameValue(integer, -0)) {
|
|
55
|
-
return 0;
|
|
56
|
-
}
|
|
57
|
-
return integer;
|
|
58
|
-
}
|
|
59
|
-
/**
|
|
60
|
-
* https://tc39.es/ecma262/#sec-timeclip
|
|
61
|
-
* @param time
|
|
62
|
-
*/
|
|
63
|
-
function TimeClip(time) {
|
|
64
|
-
if (!isFinite(time)) {
|
|
65
|
-
return NaN;
|
|
66
|
-
}
|
|
67
|
-
if (Math.abs(time) > 8.64 * 1e15) {
|
|
68
|
-
return NaN;
|
|
69
|
-
}
|
|
70
|
-
return ToInteger(time);
|
|
71
|
-
}
|
|
72
|
-
exports.TimeClip = TimeClip;
|
|
73
|
-
/**
|
|
74
|
-
* https://tc39.es/ecma262/#sec-toobject
|
|
75
|
-
* @param arg
|
|
76
|
-
*/
|
|
77
|
-
function ToObject(arg) {
|
|
78
|
-
if (arg == null) {
|
|
79
|
-
throw new TypeError('undefined/null cannot be converted to object');
|
|
80
|
-
}
|
|
81
|
-
return Object(arg);
|
|
82
|
-
}
|
|
83
|
-
exports.ToObject = ToObject;
|
|
84
|
-
/**
|
|
85
|
-
* https://www.ecma-international.org/ecma-262/11.0/index.html#sec-samevalue
|
|
86
|
-
* @param x
|
|
87
|
-
* @param y
|
|
88
|
-
*/
|
|
89
|
-
function SameValue(x, y) {
|
|
90
|
-
if (Object.is) {
|
|
91
|
-
return Object.is(x, y);
|
|
92
|
-
}
|
|
93
|
-
// SameValue algorithm
|
|
94
|
-
if (x === y) {
|
|
95
|
-
// Steps 1-5, 7-10
|
|
96
|
-
// Steps 6.b-6.e: +0 != -0
|
|
97
|
-
return x !== 0 || 1 / x === 1 / y;
|
|
98
|
-
}
|
|
99
|
-
// Step 6.a: NaN == NaN
|
|
100
|
-
return x !== x && y !== y;
|
|
101
|
-
}
|
|
102
|
-
exports.SameValue = SameValue;
|
|
103
|
-
/**
|
|
104
|
-
* https://www.ecma-international.org/ecma-262/11.0/index.html#sec-arraycreate
|
|
105
|
-
* @param len
|
|
106
|
-
*/
|
|
107
|
-
function ArrayCreate(len) {
|
|
108
|
-
return new Array(len);
|
|
109
|
-
}
|
|
110
|
-
exports.ArrayCreate = ArrayCreate;
|
|
111
|
-
/**
|
|
112
|
-
* https://www.ecma-international.org/ecma-262/11.0/index.html#sec-hasownproperty
|
|
113
|
-
* @param o
|
|
114
|
-
* @param prop
|
|
115
|
-
*/
|
|
116
|
-
function HasOwnProperty(o, prop) {
|
|
117
|
-
return Object.prototype.hasOwnProperty.call(o, prop);
|
|
118
|
-
}
|
|
119
|
-
exports.HasOwnProperty = HasOwnProperty;
|
|
120
|
-
/**
|
|
121
|
-
* https://www.ecma-international.org/ecma-262/11.0/index.html#sec-type
|
|
122
|
-
* @param x
|
|
123
|
-
*/
|
|
124
|
-
function Type(x) {
|
|
125
|
-
if (x === null) {
|
|
126
|
-
return 'Null';
|
|
127
|
-
}
|
|
128
|
-
if (typeof x === 'undefined') {
|
|
129
|
-
return 'Undefined';
|
|
130
|
-
}
|
|
131
|
-
if (typeof x === 'function' || typeof x === 'object') {
|
|
132
|
-
return 'Object';
|
|
133
|
-
}
|
|
134
|
-
if (typeof x === 'number') {
|
|
135
|
-
return 'Number';
|
|
136
|
-
}
|
|
137
|
-
if (typeof x === 'boolean') {
|
|
138
|
-
return 'Boolean';
|
|
139
|
-
}
|
|
140
|
-
if (typeof x === 'string') {
|
|
141
|
-
return 'String';
|
|
142
|
-
}
|
|
143
|
-
if (typeof x === 'symbol') {
|
|
144
|
-
return 'Symbol';
|
|
145
|
-
}
|
|
146
|
-
if (typeof x === 'bigint') {
|
|
147
|
-
return 'BigInt';
|
|
148
|
-
}
|
|
149
|
-
}
|
|
150
|
-
exports.Type = Type;
|
|
151
|
-
var MS_PER_DAY = 86400000;
|
|
152
|
-
/**
|
|
153
|
-
* https://www.ecma-international.org/ecma-262/11.0/index.html#eqn-modulo
|
|
154
|
-
* @param x
|
|
155
|
-
* @param y
|
|
156
|
-
* @return k of the same sign as y
|
|
157
|
-
*/
|
|
158
|
-
function mod(x, y) {
|
|
159
|
-
return x - Math.floor(x / y) * y;
|
|
160
|
-
}
|
|
161
|
-
/**
|
|
162
|
-
* https://tc39.es/ecma262/#eqn-Day
|
|
163
|
-
* @param t
|
|
164
|
-
*/
|
|
165
|
-
function Day(t) {
|
|
166
|
-
return Math.floor(t / MS_PER_DAY);
|
|
167
|
-
}
|
|
168
|
-
exports.Day = Day;
|
|
169
|
-
/**
|
|
170
|
-
* https://tc39.es/ecma262/#sec-week-day
|
|
171
|
-
* @param t
|
|
172
|
-
*/
|
|
173
|
-
function WeekDay(t) {
|
|
174
|
-
return mod(Day(t) + 4, 7);
|
|
175
|
-
}
|
|
176
|
-
exports.WeekDay = WeekDay;
|
|
177
|
-
/**
|
|
178
|
-
* https://tc39.es/ecma262/#sec-year-number
|
|
179
|
-
* @param y
|
|
180
|
-
*/
|
|
181
|
-
function DayFromYear(y) {
|
|
182
|
-
return Date.UTC(y, 0) / MS_PER_DAY;
|
|
183
|
-
}
|
|
184
|
-
exports.DayFromYear = DayFromYear;
|
|
185
|
-
/**
|
|
186
|
-
* https://tc39.es/ecma262/#sec-year-number
|
|
187
|
-
* @param y
|
|
188
|
-
*/
|
|
189
|
-
function TimeFromYear(y) {
|
|
190
|
-
return Date.UTC(y, 0);
|
|
191
|
-
}
|
|
192
|
-
exports.TimeFromYear = TimeFromYear;
|
|
193
|
-
/**
|
|
194
|
-
* https://tc39.es/ecma262/#sec-year-number
|
|
195
|
-
* @param t
|
|
196
|
-
*/
|
|
197
|
-
function YearFromTime(t) {
|
|
198
|
-
return new Date(t).getUTCFullYear();
|
|
199
|
-
}
|
|
200
|
-
exports.YearFromTime = YearFromTime;
|
|
201
|
-
function DaysInYear(y) {
|
|
202
|
-
if (y % 4 !== 0) {
|
|
203
|
-
return 365;
|
|
204
|
-
}
|
|
205
|
-
if (y % 100 !== 0) {
|
|
206
|
-
return 366;
|
|
207
|
-
}
|
|
208
|
-
if (y % 400 !== 0) {
|
|
209
|
-
return 365;
|
|
210
|
-
}
|
|
211
|
-
return 366;
|
|
212
|
-
}
|
|
213
|
-
exports.DaysInYear = DaysInYear;
|
|
214
|
-
function DayWithinYear(t) {
|
|
215
|
-
return Day(t) - DayFromYear(YearFromTime(t));
|
|
216
|
-
}
|
|
217
|
-
exports.DayWithinYear = DayWithinYear;
|
|
218
|
-
function InLeapYear(t) {
|
|
219
|
-
return DaysInYear(YearFromTime(t)) === 365 ? 0 : 1;
|
|
220
|
-
}
|
|
221
|
-
exports.InLeapYear = InLeapYear;
|
|
222
|
-
/**
|
|
223
|
-
* https://tc39.es/ecma262/#sec-month-number
|
|
224
|
-
* @param t
|
|
225
|
-
*/
|
|
226
|
-
function MonthFromTime(t) {
|
|
227
|
-
var dwy = DayWithinYear(t);
|
|
228
|
-
var leap = InLeapYear(t);
|
|
229
|
-
if (dwy >= 0 && dwy < 31) {
|
|
230
|
-
return 0;
|
|
231
|
-
}
|
|
232
|
-
if (dwy < 59 + leap) {
|
|
233
|
-
return 1;
|
|
234
|
-
}
|
|
235
|
-
if (dwy < 90 + leap) {
|
|
236
|
-
return 2;
|
|
237
|
-
}
|
|
238
|
-
if (dwy < 120 + leap) {
|
|
239
|
-
return 3;
|
|
240
|
-
}
|
|
241
|
-
if (dwy < 151 + leap) {
|
|
242
|
-
return 4;
|
|
243
|
-
}
|
|
244
|
-
if (dwy < 181 + leap) {
|
|
245
|
-
return 5;
|
|
246
|
-
}
|
|
247
|
-
if (dwy < 212 + leap) {
|
|
248
|
-
return 6;
|
|
249
|
-
}
|
|
250
|
-
if (dwy < 243 + leap) {
|
|
251
|
-
return 7;
|
|
252
|
-
}
|
|
253
|
-
if (dwy < 273 + leap) {
|
|
254
|
-
return 8;
|
|
255
|
-
}
|
|
256
|
-
if (dwy < 304 + leap) {
|
|
257
|
-
return 9;
|
|
258
|
-
}
|
|
259
|
-
if (dwy < 334 + leap) {
|
|
260
|
-
return 10;
|
|
261
|
-
}
|
|
262
|
-
if (dwy < 365 + leap) {
|
|
263
|
-
return 11;
|
|
264
|
-
}
|
|
265
|
-
throw new Error('Invalid time');
|
|
266
|
-
}
|
|
267
|
-
exports.MonthFromTime = MonthFromTime;
|
|
268
|
-
function DateFromTime(t) {
|
|
269
|
-
var dwy = DayWithinYear(t);
|
|
270
|
-
var mft = MonthFromTime(t);
|
|
271
|
-
var leap = InLeapYear(t);
|
|
272
|
-
if (mft === 0) {
|
|
273
|
-
return dwy + 1;
|
|
274
|
-
}
|
|
275
|
-
if (mft === 1) {
|
|
276
|
-
return dwy - 30;
|
|
277
|
-
}
|
|
278
|
-
if (mft === 2) {
|
|
279
|
-
return dwy - 58 - leap;
|
|
280
|
-
}
|
|
281
|
-
if (mft === 3) {
|
|
282
|
-
return dwy - 89 - leap;
|
|
283
|
-
}
|
|
284
|
-
if (mft === 4) {
|
|
285
|
-
return dwy - 119 - leap;
|
|
286
|
-
}
|
|
287
|
-
if (mft === 5) {
|
|
288
|
-
return dwy - 150 - leap;
|
|
289
|
-
}
|
|
290
|
-
if (mft === 6) {
|
|
291
|
-
return dwy - 180 - leap;
|
|
292
|
-
}
|
|
293
|
-
if (mft === 7) {
|
|
294
|
-
return dwy - 211 - leap;
|
|
295
|
-
}
|
|
296
|
-
if (mft === 8) {
|
|
297
|
-
return dwy - 242 - leap;
|
|
298
|
-
}
|
|
299
|
-
if (mft === 9) {
|
|
300
|
-
return dwy - 272 - leap;
|
|
301
|
-
}
|
|
302
|
-
if (mft === 10) {
|
|
303
|
-
return dwy - 303 - leap;
|
|
304
|
-
}
|
|
305
|
-
if (mft === 11) {
|
|
306
|
-
return dwy - 333 - leap;
|
|
307
|
-
}
|
|
308
|
-
throw new Error('Invalid time');
|
|
309
|
-
}
|
|
310
|
-
exports.DateFromTime = DateFromTime;
|
|
311
|
-
var HOURS_PER_DAY = 24;
|
|
312
|
-
var MINUTES_PER_HOUR = 60;
|
|
313
|
-
var SECONDS_PER_MINUTE = 60;
|
|
314
|
-
var MS_PER_SECOND = 1e3;
|
|
315
|
-
var MS_PER_MINUTE = MS_PER_SECOND * SECONDS_PER_MINUTE;
|
|
316
|
-
var MS_PER_HOUR = MS_PER_MINUTE * MINUTES_PER_HOUR;
|
|
317
|
-
function HourFromTime(t) {
|
|
318
|
-
return mod(Math.floor(t / MS_PER_HOUR), HOURS_PER_DAY);
|
|
319
|
-
}
|
|
320
|
-
exports.HourFromTime = HourFromTime;
|
|
321
|
-
function MinFromTime(t) {
|
|
322
|
-
return mod(Math.floor(t / MS_PER_MINUTE), MINUTES_PER_HOUR);
|
|
323
|
-
}
|
|
324
|
-
exports.MinFromTime = MinFromTime;
|
|
325
|
-
function SecFromTime(t) {
|
|
326
|
-
return mod(Math.floor(t / MS_PER_SECOND), SECONDS_PER_MINUTE);
|
|
327
|
-
}
|
|
328
|
-
exports.SecFromTime = SecFromTime;
|
|
329
|
-
function IsCallable(fn) {
|
|
330
|
-
return typeof fn === 'function';
|
|
331
|
-
}
|
|
332
|
-
/**
|
|
333
|
-
* The abstract operation OrdinaryHasInstance implements
|
|
334
|
-
* the default algorithm for determining if an object O
|
|
335
|
-
* inherits from the instance object inheritance path
|
|
336
|
-
* provided by constructor C.
|
|
337
|
-
* @param C class
|
|
338
|
-
* @param O object
|
|
339
|
-
* @param internalSlots internalSlots
|
|
340
|
-
*/
|
|
341
|
-
function OrdinaryHasInstance(C, O, internalSlots) {
|
|
342
|
-
if (!IsCallable(C)) {
|
|
343
|
-
return false;
|
|
344
|
-
}
|
|
345
|
-
if (internalSlots === null || internalSlots === void 0 ? void 0 : internalSlots.boundTargetFunction) {
|
|
346
|
-
var BC = internalSlots === null || internalSlots === void 0 ? void 0 : internalSlots.boundTargetFunction;
|
|
347
|
-
return O instanceof BC;
|
|
348
|
-
}
|
|
349
|
-
if (typeof O !== 'object') {
|
|
350
|
-
return false;
|
|
351
|
-
}
|
|
352
|
-
var P = C.prototype;
|
|
353
|
-
if (typeof P !== 'object') {
|
|
354
|
-
throw new TypeError('OrdinaryHasInstance called on an object with an invalid prototype property.');
|
|
355
|
-
}
|
|
356
|
-
return Object.prototype.isPrototypeOf.call(P, O);
|
|
357
|
-
}
|
|
358
|
-
exports.OrdinaryHasInstance = OrdinaryHasInstance;
|
|
359
|
-
function msFromTime(t) {
|
|
360
|
-
return mod(t, MS_PER_SECOND);
|
|
361
|
-
}
|
|
362
|
-
exports.msFromTime = msFromTime;
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"CanonicalizeLocaleList.d.ts","sourceRoot":"","sources":["../../../../../packages/ecma402-abstract/CanonicalizeLocaleList.ts"],"names":[],"mappings":"AAAA;;;GAGG;AACH,wBAAgB,sBAAsB,CAAC,OAAO,CAAC,EAAE,MAAM,GAAG,MAAM,EAAE,GAAG,MAAM,EAAE,CAG5E"}
|
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.CanonicalizeLocaleList = void 0;
|
|
4
|
-
/**
|
|
5
|
-
* http://ecma-international.org/ecma-402/7.0/index.html#sec-canonicalizelocalelist
|
|
6
|
-
* @param locales
|
|
7
|
-
*/
|
|
8
|
-
function CanonicalizeLocaleList(locales) {
|
|
9
|
-
// TODO
|
|
10
|
-
return Intl.getCanonicalLocales(locales);
|
|
11
|
-
}
|
|
12
|
-
exports.CanonicalizeLocaleList = CanonicalizeLocaleList;
|
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* https://tc39.es/ecma402/#sec-canonicalizetimezonename
|
|
3
|
-
* @param tz
|
|
4
|
-
*/
|
|
5
|
-
export declare function CanonicalizeTimeZoneName(tz: string, { tzData, uppercaseLinks, }: {
|
|
6
|
-
tzData: Record<string, unknown>;
|
|
7
|
-
uppercaseLinks: Record<string, string>;
|
|
8
|
-
}): string;
|
|
9
|
-
//# sourceMappingURL=CanonicalizeTimeZoneName.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"CanonicalizeTimeZoneName.d.ts","sourceRoot":"","sources":["../../../../../packages/ecma402-abstract/CanonicalizeTimeZoneName.ts"],"names":[],"mappings":"AAAA;;;GAGG;AACH,wBAAgB,wBAAwB,CACtC,EAAE,EAAE,MAAM,EACV,EACE,MAAM,EACN,cAAc,GACf,EAAE;IACD,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAA;IAC/B,cAAc,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAA;CACvC,UAgBF"}
|
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.CanonicalizeTimeZoneName = void 0;
|
|
4
|
-
/**
|
|
5
|
-
* https://tc39.es/ecma402/#sec-canonicalizetimezonename
|
|
6
|
-
* @param tz
|
|
7
|
-
*/
|
|
8
|
-
function CanonicalizeTimeZoneName(tz, _a) {
|
|
9
|
-
var tzData = _a.tzData, uppercaseLinks = _a.uppercaseLinks;
|
|
10
|
-
var uppercasedTz = tz.toUpperCase();
|
|
11
|
-
var uppercasedZones = Object.keys(tzData).reduce(function (all, z) {
|
|
12
|
-
all[z.toUpperCase()] = z;
|
|
13
|
-
return all;
|
|
14
|
-
}, {});
|
|
15
|
-
var ianaTimeZone = uppercaseLinks[uppercasedTz] || uppercasedZones[uppercasedTz];
|
|
16
|
-
if (ianaTimeZone === 'Etc/UTC' || ianaTimeZone === 'Etc/GMT') {
|
|
17
|
-
return 'UTC';
|
|
18
|
-
}
|
|
19
|
-
return ianaTimeZone;
|
|
20
|
-
}
|
|
21
|
-
exports.CanonicalizeTimeZoneName = CanonicalizeTimeZoneName;
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"CoerceOptionsToObject.d.ts","sourceRoot":"","sources":["../../../../../packages/ecma402-abstract/CoerceOptionsToObject.ts"],"names":[],"mappings":"AAEA;;;;GAIG;AACH,wBAAgB,qBAAqB,CAAC,CAAC,EAAE,OAAO,CAAC,EAAE,CAAC,GAAG,CAAC,CAKvD"}
|
package/CoerceOptionsToObject.js
DELETED
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.CoerceOptionsToObject = void 0;
|
|
4
|
-
var _262_1 = require("./262");
|
|
5
|
-
/**
|
|
6
|
-
* https://tc39.es/ecma402/#sec-coerceoptionstoobject
|
|
7
|
-
* @param options
|
|
8
|
-
* @returns
|
|
9
|
-
*/
|
|
10
|
-
function CoerceOptionsToObject(options) {
|
|
11
|
-
if (typeof options === 'undefined') {
|
|
12
|
-
return Object.create(null);
|
|
13
|
-
}
|
|
14
|
-
return (0, _262_1.ToObject)(options);
|
|
15
|
-
}
|
|
16
|
-
exports.CoerceOptionsToObject = CoerceOptionsToObject;
|
package/DefaultNumberOption.d.ts
DELETED
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* https://tc39.es/ecma402/#sec-defaultnumberoption
|
|
3
|
-
* @param val
|
|
4
|
-
* @param min
|
|
5
|
-
* @param max
|
|
6
|
-
* @param fallback
|
|
7
|
-
*/
|
|
8
|
-
export declare function DefaultNumberOption(val: any, min: number, max: number, fallback: number): number;
|
|
9
|
-
//# sourceMappingURL=DefaultNumberOption.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"DefaultNumberOption.d.ts","sourceRoot":"","sources":["../../../../../packages/ecma402-abstract/DefaultNumberOption.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AACH,wBAAgB,mBAAmB,CACjC,GAAG,EAAE,GAAG,EACR,GAAG,EAAE,MAAM,EACX,GAAG,EAAE,MAAM,EACX,QAAQ,EAAE,MAAM,GACf,MAAM,CAAA"}
|
package/DefaultNumberOption.js
DELETED
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.DefaultNumberOption = void 0;
|
|
4
|
-
function DefaultNumberOption(val, min, max, fallback) {
|
|
5
|
-
if (val !== undefined) {
|
|
6
|
-
val = Number(val);
|
|
7
|
-
if (isNaN(val) || val < min || val > max) {
|
|
8
|
-
throw new RangeError("".concat(val, " is outside of range [").concat(min, ", ").concat(max, "]"));
|
|
9
|
-
}
|
|
10
|
-
return Math.floor(val);
|
|
11
|
-
}
|
|
12
|
-
return fallback;
|
|
13
|
-
}
|
|
14
|
-
exports.DefaultNumberOption = DefaultNumberOption;
|
package/GetNumberOption.d.ts
DELETED
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* https://tc39.es/ecma402/#sec-getnumberoption
|
|
3
|
-
* @param options
|
|
4
|
-
* @param property
|
|
5
|
-
* @param min
|
|
6
|
-
* @param max
|
|
7
|
-
* @param fallback
|
|
8
|
-
*/
|
|
9
|
-
export declare function GetNumberOption<T extends object, K extends keyof T>(options: T, property: K, minimum: number, maximum: number, fallback: number): number;
|
|
10
|
-
//# sourceMappingURL=GetNumberOption.d.ts.map
|
package/GetNumberOption.d.ts.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"GetNumberOption.d.ts","sourceRoot":"","sources":["../../../../../packages/ecma402-abstract/GetNumberOption.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAIH,wBAAgB,eAAe,CAAC,CAAC,SAAS,MAAM,EAAE,CAAC,SAAS,MAAM,CAAC,EACjE,OAAO,EAAE,CAAC,EACV,QAAQ,EAAE,CAAC,EACX,OAAO,EAAE,MAAM,EACf,OAAO,EAAE,MAAM,EACf,QAAQ,EAAE,MAAM,GACf,MAAM,CAAA"}
|
package/GetNumberOption.js
DELETED
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
/**
|
|
3
|
-
* https://tc39.es/ecma402/#sec-getnumberoption
|
|
4
|
-
* @param options
|
|
5
|
-
* @param property
|
|
6
|
-
* @param min
|
|
7
|
-
* @param max
|
|
8
|
-
* @param fallback
|
|
9
|
-
*/
|
|
10
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
11
|
-
exports.GetNumberOption = void 0;
|
|
12
|
-
var DefaultNumberOption_1 = require("./DefaultNumberOption");
|
|
13
|
-
function GetNumberOption(options, property, minimum, maximum, fallback) {
|
|
14
|
-
var val = options[property];
|
|
15
|
-
// @ts-expect-error
|
|
16
|
-
return (0, DefaultNumberOption_1.DefaultNumberOption)(val, minimum, maximum, fallback);
|
|
17
|
-
}
|
|
18
|
-
exports.GetNumberOption = GetNumberOption;
|
package/GetOption.d.ts
DELETED
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* https://tc39.es/ecma402/#sec-getoption
|
|
3
|
-
* @param opts
|
|
4
|
-
* @param prop
|
|
5
|
-
* @param type
|
|
6
|
-
* @param values
|
|
7
|
-
* @param fallback
|
|
8
|
-
*/
|
|
9
|
-
export declare function GetOption<T extends object, K extends keyof T, F>(opts: T, prop: K, type: 'string' | 'boolean', values: T[K][] | undefined, fallback: F): Exclude<T[K], undefined> | F;
|
|
10
|
-
//# sourceMappingURL=GetOption.d.ts.map
|
package/GetOption.d.ts.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"GetOption.d.ts","sourceRoot":"","sources":["../../../../../packages/ecma402-abstract/GetOption.ts"],"names":[],"mappings":"AAEA;;;;;;;GAOG;AACH,wBAAgB,SAAS,CAAC,CAAC,SAAS,MAAM,EAAE,CAAC,SAAS,MAAM,CAAC,EAAE,CAAC,EAC9D,IAAI,EAAE,CAAC,EACP,IAAI,EAAE,CAAC,EACP,IAAI,EAAE,QAAQ,GAAG,SAAS,EAC1B,MAAM,EAAE,CAAC,CAAC,CAAC,CAAC,EAAE,GAAG,SAAS,EAC1B,QAAQ,EAAE,CAAC,GACV,OAAO,CAAC,CAAC,CAAC,CAAC,CAAC,EAAE,SAAS,CAAC,GAAG,CAAC,CAqB9B"}
|
package/GetOption.js
DELETED
|
@@ -1,35 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.GetOption = void 0;
|
|
4
|
-
var _262_1 = require("./262");
|
|
5
|
-
/**
|
|
6
|
-
* https://tc39.es/ecma402/#sec-getoption
|
|
7
|
-
* @param opts
|
|
8
|
-
* @param prop
|
|
9
|
-
* @param type
|
|
10
|
-
* @param values
|
|
11
|
-
* @param fallback
|
|
12
|
-
*/
|
|
13
|
-
function GetOption(opts, prop, type, values, fallback) {
|
|
14
|
-
if (typeof opts !== 'object') {
|
|
15
|
-
throw new TypeError('Options must be an object');
|
|
16
|
-
}
|
|
17
|
-
var value = opts[prop];
|
|
18
|
-
if (value !== undefined) {
|
|
19
|
-
if (type !== 'boolean' && type !== 'string') {
|
|
20
|
-
throw new TypeError('invalid type');
|
|
21
|
-
}
|
|
22
|
-
if (type === 'boolean') {
|
|
23
|
-
value = Boolean(value);
|
|
24
|
-
}
|
|
25
|
-
if (type === 'string') {
|
|
26
|
-
value = (0, _262_1.ToString)(value);
|
|
27
|
-
}
|
|
28
|
-
if (values !== undefined && !values.filter(function (val) { return val == value; }).length) {
|
|
29
|
-
throw new RangeError("".concat(value, " is not within ").concat(values.join(', ')));
|
|
30
|
-
}
|
|
31
|
-
return value;
|
|
32
|
-
}
|
|
33
|
-
return fallback;
|
|
34
|
-
}
|
|
35
|
-
exports.GetOption = GetOption;
|
package/GetOptionsObject.d.ts
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"GetOptionsObject.d.ts","sourceRoot":"","sources":["../../../../../packages/ecma402-abstract/GetOptionsObject.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AACH,wBAAgB,gBAAgB,CAAC,CAAC,SAAS,MAAM,EAAE,OAAO,CAAC,EAAE,CAAC,GAAG,CAAC,CAQjE"}
|
package/GetOptionsObject.js
DELETED
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.GetOptionsObject = void 0;
|
|
4
|
-
/**
|
|
5
|
-
* https://tc39.es/ecma402/#sec-getoptionsobject
|
|
6
|
-
* @param options
|
|
7
|
-
* @returns
|
|
8
|
-
*/
|
|
9
|
-
function GetOptionsObject(options) {
|
|
10
|
-
if (typeof options === 'undefined') {
|
|
11
|
-
return Object.create(null);
|
|
12
|
-
}
|
|
13
|
-
if (typeof options === 'object') {
|
|
14
|
-
return options;
|
|
15
|
-
}
|
|
16
|
-
throw new TypeError('Options must be an object');
|
|
17
|
-
}
|
|
18
|
-
exports.GetOptionsObject = GetOptionsObject;
|
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* https://tc39.es/ecma402/#table-sanctioned-simple-unit-identifiers
|
|
3
|
-
*/
|
|
4
|
-
export declare const SANCTIONED_UNITS: string[];
|
|
5
|
-
export declare function removeUnitNamespace(unit: string): string;
|
|
6
|
-
/**
|
|
7
|
-
* https://tc39.es/ecma402/#table-sanctioned-simple-unit-identifiers
|
|
8
|
-
*/
|
|
9
|
-
export declare const SIMPLE_UNITS: string[];
|
|
10
|
-
/**
|
|
11
|
-
* https://tc39.es/ecma402/#sec-issanctionedsimpleunitidentifier
|
|
12
|
-
*/
|
|
13
|
-
export declare function IsSanctionedSimpleUnitIdentifier(unitIdentifier: string): boolean;
|
|
14
|
-
//# sourceMappingURL=IsSanctionedSimpleUnitIdentifier.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"IsSanctionedSimpleUnitIdentifier.d.ts","sourceRoot":"","sources":["../../../../../packages/ecma402-abstract/IsSanctionedSimpleUnitIdentifier.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH,eAAO,MAAM,gBAAgB,UA4C5B,CAAA;AAID,wBAAgB,mBAAmB,CAAC,IAAI,EAAE,MAAM,UAE/C;AAED;;GAEG;AACH,eAAO,MAAM,YAAY,UAA4C,CAAA;AAErE;;GAEG;AACH,wBAAgB,gCAAgC,CAAC,cAAc,EAAE,MAAM,WAEtE"}
|