@formatjs/ecma402-abstract 1.18.2 → 2.0.0
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/NumberFormat/format_to_parts.d.ts +1 -1
- package/NumberFormat/format_to_parts.js +12 -5
- package/index.d.ts +6 -6
- package/index.js +8 -7
- package/lib/NumberFormat/format_to_parts.d.ts +1 -1
- package/lib/NumberFormat/format_to_parts.js +12 -5
- package/lib/index.d.ts +6 -6
- package/lib/index.js +5 -5
- package/lib/types/number.d.ts +3 -1
- package/lib/utils.d.ts +7 -0
- package/lib/utils.js +14 -0
- package/package.json +1 -1
- package/types/number.d.ts +3 -1
- package/utils.d.ts +7 -0
- package/utils.js +16 -1
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { NumberFormatLocaleInternalData, NumberFormatOptionsCompactDisplay, NumberFormatOptionsCurrencyDisplay, NumberFormatOptionsCurrencySign, NumberFormatOptionsNotation, NumberFormatOptionsStyle, NumberFormatOptionsUnitDisplay, NumberFormatPart, UseGroupingType } from '../types/number';
|
|
2
2
|
interface NumberResult {
|
|
3
3
|
formattedString: string;
|
|
4
4
|
roundedNumber: number;
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
var regex_generated_1 = require("../regex.generated");
|
|
3
4
|
var ToRawFixed_1 = require("./ToRawFixed");
|
|
4
5
|
var digit_mapping_generated_1 = require("./digit-mapping.generated");
|
|
5
|
-
var regex_generated_1 = require("../regex.generated");
|
|
6
6
|
// This is from: unicode-12.1.0/General_Category/Symbol/regex.js
|
|
7
7
|
// IE11 does not support unicode flag, otherwise this is just /\p{S}/u.
|
|
8
8
|
// /^\p{S}/u
|
|
@@ -119,7 +119,7 @@ function formatToParts(numberResult, data, pl, options) {
|
|
|
119
119
|
// We only need to handle scientific and engineering notation here.
|
|
120
120
|
numberParts.push.apply(numberParts, paritionNumberIntoParts(symbols, numberResult, notation, exponent, numberingSystem,
|
|
121
121
|
// If compact number pattern exists, do not insert group separators.
|
|
122
|
-
!compactNumberPattern && Boolean(options.useGrouping), decimalNumberPattern));
|
|
122
|
+
!compactNumberPattern && Boolean(options.useGrouping), decimalNumberPattern, style));
|
|
123
123
|
break;
|
|
124
124
|
}
|
|
125
125
|
case '-':
|
|
@@ -262,7 +262,7 @@ function paritionNumberIntoParts(symbols, numberResult, notation, exponent, numb
|
|
|
262
262
|
* A typical value looks like "#,##0.00" (primary group size is 3).
|
|
263
263
|
* Some locales like Hindi has secondary group size of 2 (e.g. "#,##,##0.00").
|
|
264
264
|
*/
|
|
265
|
-
decimalNumberPattern) {
|
|
265
|
+
decimalNumberPattern, style) {
|
|
266
266
|
var result = [];
|
|
267
267
|
// eslint-disable-next-line prefer-const
|
|
268
268
|
var n = numberResult.formattedString, x = numberResult.roundedNumber;
|
|
@@ -295,7 +295,11 @@ decimalNumberPattern) {
|
|
|
295
295
|
// NumberFormat('de', {notation: 'compact', compactDisplay: 'short'}).format(1234) //=> "1234"
|
|
296
296
|
// NumberFormat('de').format(1234) //=> "1.234"
|
|
297
297
|
if (useGrouping && (notation !== 'compact' || x >= 10000)) {
|
|
298
|
-
|
|
298
|
+
// a. Let groupSepSymbol be the implementation-, locale-, and numbering system-dependent (ILND) String representing the grouping separator.
|
|
299
|
+
// For currency we should use `currencyGroup` instead of generic `group`
|
|
300
|
+
var groupSepSymbol = style === 'currency' && symbols.currencyGroup != null
|
|
301
|
+
? symbols.currencyGroup
|
|
302
|
+
: symbols.group;
|
|
299
303
|
var groups = [];
|
|
300
304
|
// > There may be two different grouping sizes: The primary grouping size used for the least
|
|
301
305
|
// > significant integer group, and the secondary grouping size used for more significant groups.
|
|
@@ -339,7 +343,10 @@ decimalNumberPattern) {
|
|
|
339
343
|
}
|
|
340
344
|
// #endregion
|
|
341
345
|
if (fraction !== undefined) {
|
|
342
|
-
|
|
346
|
+
var decimalSepSymbol = style === 'currency' && symbols.currencyDecimal != null
|
|
347
|
+
? symbols.currencyDecimal
|
|
348
|
+
: symbols.decimal;
|
|
349
|
+
result.push({ type: 'decimal', value: decimalSepSymbol }, { type: 'fraction', value: fraction });
|
|
343
350
|
}
|
|
344
351
|
if ((notation === 'scientific' || notation === 'engineering') &&
|
|
345
352
|
isFinite(x)) {
|
package/index.d.ts
CHANGED
|
@@ -30,15 +30,15 @@ export * from './NumberFormat/ToRawPrecision';
|
|
|
30
30
|
export { default as _formatToParts } from './NumberFormat/format_to_parts';
|
|
31
31
|
export * from './PartitionPattern';
|
|
32
32
|
export * from './SupportedLocales';
|
|
33
|
-
export { getInternalSlot, getMultiInternalSlots, isLiteralPart, setInternalSlot, setMultiInternalSlots,
|
|
33
|
+
export { createDataProperty, defineProperty, getInternalSlot, getMagnitude, getMultiInternalSlots, isLiteralPart, setInternalSlot, setMultiInternalSlots, } from './utils';
|
|
34
34
|
export type { LiteralPart } from './utils';
|
|
35
|
+
export * from './262';
|
|
35
36
|
export { isMissingLocaleDataError } from './data';
|
|
36
|
-
export
|
|
37
|
+
export type { LocaleData } from './types/core';
|
|
37
38
|
export * from './types/date-time';
|
|
39
|
+
export * from './types/displaynames';
|
|
38
40
|
export * from './types/list';
|
|
39
|
-
export * from './types/plural-rules';
|
|
40
41
|
export * from './types/number';
|
|
41
|
-
export * from './types/
|
|
42
|
+
export * from './types/plural-rules';
|
|
43
|
+
export * from './types/relative-time';
|
|
42
44
|
export { invariant } from './utils';
|
|
43
|
-
export type { LocaleData } from './types/core';
|
|
44
|
-
export * from './262';
|
package/index.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.invariant = exports.isMissingLocaleDataError = exports.
|
|
3
|
+
exports.invariant = exports.isMissingLocaleDataError = exports.setMultiInternalSlots = exports.setInternalSlot = exports.isLiteralPart = exports.getMultiInternalSlots = exports.getMagnitude = exports.getInternalSlot = exports.defineProperty = exports.createDataProperty = exports._formatToParts = void 0;
|
|
4
4
|
var tslib_1 = require("tslib");
|
|
5
5
|
tslib_1.__exportStar(require("./CanonicalizeLocaleList"), exports);
|
|
6
6
|
tslib_1.__exportStar(require("./CanonicalizeTimeZoneName"), exports);
|
|
@@ -36,21 +36,22 @@ Object.defineProperty(exports, "_formatToParts", { enumerable: true, get: functi
|
|
|
36
36
|
tslib_1.__exportStar(require("./PartitionPattern"), exports);
|
|
37
37
|
tslib_1.__exportStar(require("./SupportedLocales"), exports);
|
|
38
38
|
var utils_1 = require("./utils");
|
|
39
|
+
Object.defineProperty(exports, "createDataProperty", { enumerable: true, get: function () { return utils_1.createDataProperty; } });
|
|
40
|
+
Object.defineProperty(exports, "defineProperty", { enumerable: true, get: function () { return utils_1.defineProperty; } });
|
|
39
41
|
Object.defineProperty(exports, "getInternalSlot", { enumerable: true, get: function () { return utils_1.getInternalSlot; } });
|
|
42
|
+
Object.defineProperty(exports, "getMagnitude", { enumerable: true, get: function () { return utils_1.getMagnitude; } });
|
|
40
43
|
Object.defineProperty(exports, "getMultiInternalSlots", { enumerable: true, get: function () { return utils_1.getMultiInternalSlots; } });
|
|
41
44
|
Object.defineProperty(exports, "isLiteralPart", { enumerable: true, get: function () { return utils_1.isLiteralPart; } });
|
|
42
45
|
Object.defineProperty(exports, "setInternalSlot", { enumerable: true, get: function () { return utils_1.setInternalSlot; } });
|
|
43
46
|
Object.defineProperty(exports, "setMultiInternalSlots", { enumerable: true, get: function () { return utils_1.setMultiInternalSlots; } });
|
|
44
|
-
|
|
45
|
-
Object.defineProperty(exports, "defineProperty", { enumerable: true, get: function () { return utils_1.defineProperty; } });
|
|
47
|
+
tslib_1.__exportStar(require("./262"), exports);
|
|
46
48
|
var data_1 = require("./data");
|
|
47
49
|
Object.defineProperty(exports, "isMissingLocaleDataError", { enumerable: true, get: function () { return data_1.isMissingLocaleDataError; } });
|
|
48
|
-
tslib_1.__exportStar(require("./types/relative-time"), exports);
|
|
49
50
|
tslib_1.__exportStar(require("./types/date-time"), exports);
|
|
51
|
+
tslib_1.__exportStar(require("./types/displaynames"), exports);
|
|
50
52
|
tslib_1.__exportStar(require("./types/list"), exports);
|
|
51
|
-
tslib_1.__exportStar(require("./types/plural-rules"), exports);
|
|
52
53
|
tslib_1.__exportStar(require("./types/number"), exports);
|
|
53
|
-
tslib_1.__exportStar(require("./types/
|
|
54
|
+
tslib_1.__exportStar(require("./types/plural-rules"), exports);
|
|
55
|
+
tslib_1.__exportStar(require("./types/relative-time"), exports);
|
|
54
56
|
var utils_2 = require("./utils");
|
|
55
57
|
Object.defineProperty(exports, "invariant", { enumerable: true, get: function () { return utils_2.invariant; } });
|
|
56
|
-
tslib_1.__exportStar(require("./262"), exports);
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { NumberFormatLocaleInternalData, NumberFormatOptionsCompactDisplay, NumberFormatOptionsCurrencyDisplay, NumberFormatOptionsCurrencySign, NumberFormatOptionsNotation, NumberFormatOptionsStyle, NumberFormatOptionsUnitDisplay, NumberFormatPart, UseGroupingType } from '../types/number';
|
|
2
2
|
interface NumberResult {
|
|
3
3
|
formattedString: string;
|
|
4
4
|
roundedNumber: number;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
+
import { S_UNICODE_REGEX } from '../regex.generated';
|
|
1
2
|
import { ToRawFixed } from './ToRawFixed';
|
|
2
3
|
import { digitMapping } from './digit-mapping.generated';
|
|
3
|
-
import { S_UNICODE_REGEX } from '../regex.generated';
|
|
4
4
|
// This is from: unicode-12.1.0/General_Category/Symbol/regex.js
|
|
5
5
|
// IE11 does not support unicode flag, otherwise this is just /\p{S}/u.
|
|
6
6
|
// /^\p{S}/u
|
|
@@ -117,7 +117,7 @@ export default function formatToParts(numberResult, data, pl, options) {
|
|
|
117
117
|
// We only need to handle scientific and engineering notation here.
|
|
118
118
|
numberParts.push.apply(numberParts, paritionNumberIntoParts(symbols, numberResult, notation, exponent, numberingSystem,
|
|
119
119
|
// If compact number pattern exists, do not insert group separators.
|
|
120
|
-
!compactNumberPattern && Boolean(options.useGrouping), decimalNumberPattern));
|
|
120
|
+
!compactNumberPattern && Boolean(options.useGrouping), decimalNumberPattern, style));
|
|
121
121
|
break;
|
|
122
122
|
}
|
|
123
123
|
case '-':
|
|
@@ -259,7 +259,7 @@ function paritionNumberIntoParts(symbols, numberResult, notation, exponent, numb
|
|
|
259
259
|
* A typical value looks like "#,##0.00" (primary group size is 3).
|
|
260
260
|
* Some locales like Hindi has secondary group size of 2 (e.g. "#,##,##0.00").
|
|
261
261
|
*/
|
|
262
|
-
decimalNumberPattern) {
|
|
262
|
+
decimalNumberPattern, style) {
|
|
263
263
|
var result = [];
|
|
264
264
|
// eslint-disable-next-line prefer-const
|
|
265
265
|
var n = numberResult.formattedString, x = numberResult.roundedNumber;
|
|
@@ -292,7 +292,11 @@ decimalNumberPattern) {
|
|
|
292
292
|
// NumberFormat('de', {notation: 'compact', compactDisplay: 'short'}).format(1234) //=> "1234"
|
|
293
293
|
// NumberFormat('de').format(1234) //=> "1.234"
|
|
294
294
|
if (useGrouping && (notation !== 'compact' || x >= 10000)) {
|
|
295
|
-
|
|
295
|
+
// a. Let groupSepSymbol be the implementation-, locale-, and numbering system-dependent (ILND) String representing the grouping separator.
|
|
296
|
+
// For currency we should use `currencyGroup` instead of generic `group`
|
|
297
|
+
var groupSepSymbol = style === 'currency' && symbols.currencyGroup != null
|
|
298
|
+
? symbols.currencyGroup
|
|
299
|
+
: symbols.group;
|
|
296
300
|
var groups = [];
|
|
297
301
|
// > There may be two different grouping sizes: The primary grouping size used for the least
|
|
298
302
|
// > significant integer group, and the secondary grouping size used for more significant groups.
|
|
@@ -336,7 +340,10 @@ decimalNumberPattern) {
|
|
|
336
340
|
}
|
|
337
341
|
// #endregion
|
|
338
342
|
if (fraction !== undefined) {
|
|
339
|
-
|
|
343
|
+
var decimalSepSymbol = style === 'currency' && symbols.currencyDecimal != null
|
|
344
|
+
? symbols.currencyDecimal
|
|
345
|
+
: symbols.decimal;
|
|
346
|
+
result.push({ type: 'decimal', value: decimalSepSymbol }, { type: 'fraction', value: fraction });
|
|
340
347
|
}
|
|
341
348
|
if ((notation === 'scientific' || notation === 'engineering') &&
|
|
342
349
|
isFinite(x)) {
|
package/lib/index.d.ts
CHANGED
|
@@ -30,15 +30,15 @@ export * from './NumberFormat/ToRawPrecision';
|
|
|
30
30
|
export { default as _formatToParts } from './NumberFormat/format_to_parts';
|
|
31
31
|
export * from './PartitionPattern';
|
|
32
32
|
export * from './SupportedLocales';
|
|
33
|
-
export { getInternalSlot, getMultiInternalSlots, isLiteralPart, setInternalSlot, setMultiInternalSlots,
|
|
33
|
+
export { createDataProperty, defineProperty, getInternalSlot, getMagnitude, getMultiInternalSlots, isLiteralPart, setInternalSlot, setMultiInternalSlots, } from './utils';
|
|
34
34
|
export type { LiteralPart } from './utils';
|
|
35
|
+
export * from './262';
|
|
35
36
|
export { isMissingLocaleDataError } from './data';
|
|
36
|
-
export
|
|
37
|
+
export type { LocaleData } from './types/core';
|
|
37
38
|
export * from './types/date-time';
|
|
39
|
+
export * from './types/displaynames';
|
|
38
40
|
export * from './types/list';
|
|
39
|
-
export * from './types/plural-rules';
|
|
40
41
|
export * from './types/number';
|
|
41
|
-
export * from './types/
|
|
42
|
+
export * from './types/plural-rules';
|
|
43
|
+
export * from './types/relative-time';
|
|
42
44
|
export { invariant } from './utils';
|
|
43
|
-
export type { LocaleData } from './types/core';
|
|
44
|
-
export * from './262';
|
package/lib/index.js
CHANGED
|
@@ -30,13 +30,13 @@ export * from './NumberFormat/ToRawPrecision';
|
|
|
30
30
|
export { default as _formatToParts } from './NumberFormat/format_to_parts';
|
|
31
31
|
export * from './PartitionPattern';
|
|
32
32
|
export * from './SupportedLocales';
|
|
33
|
-
export { getInternalSlot, getMultiInternalSlots, isLiteralPart, setInternalSlot, setMultiInternalSlots,
|
|
33
|
+
export { createDataProperty, defineProperty, getInternalSlot, getMagnitude, getMultiInternalSlots, isLiteralPart, setInternalSlot, setMultiInternalSlots, } from './utils';
|
|
34
|
+
export * from './262';
|
|
34
35
|
export { isMissingLocaleDataError } from './data';
|
|
35
|
-
export * from './types/relative-time';
|
|
36
36
|
export * from './types/date-time';
|
|
37
|
+
export * from './types/displaynames';
|
|
37
38
|
export * from './types/list';
|
|
38
|
-
export * from './types/plural-rules';
|
|
39
39
|
export * from './types/number';
|
|
40
|
-
export * from './types/
|
|
40
|
+
export * from './types/plural-rules';
|
|
41
|
+
export * from './types/relative-time';
|
|
41
42
|
export { invariant } from './utils';
|
|
42
|
-
export * from './262';
|
package/lib/types/number.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { LDMLPluralRule } from './plural-rules';
|
|
2
1
|
import { LocaleData } from './core';
|
|
2
|
+
import { LDMLPluralRule } from './plural-rules';
|
|
3
3
|
export type NumberFormatNotation = 'standard' | 'scientific' | 'engineering' | 'compact';
|
|
4
4
|
export type RoundingPriorityType = 'auto' | 'morePrecision' | 'lessPrecision';
|
|
5
5
|
export type NumberFormatRoundingType = 'morePrecision' | 'lessPrecision' | 'significantDigits' | 'fractionDigits';
|
|
@@ -87,6 +87,8 @@ export interface SymbolsData {
|
|
|
87
87
|
timeSeparator: string;
|
|
88
88
|
approximatelySign: string;
|
|
89
89
|
rangeSign: string;
|
|
90
|
+
currencyGroup?: string;
|
|
91
|
+
currencyDecimal?: string;
|
|
90
92
|
}
|
|
91
93
|
export interface RawNumberData {
|
|
92
94
|
nu: string[];
|
package/lib/utils.d.ts
CHANGED
|
@@ -19,5 +19,12 @@ export declare function isLiteralPart(patternPart: LiteralPart | {
|
|
|
19
19
|
export declare function defineProperty<T extends object>(target: T, name: string | symbol, { value }: {
|
|
20
20
|
value: any;
|
|
21
21
|
} & ThisType<any>): void;
|
|
22
|
+
/**
|
|
23
|
+
* 7.3.5 CreateDataProperty
|
|
24
|
+
* @param target
|
|
25
|
+
* @param name
|
|
26
|
+
* @param value
|
|
27
|
+
*/
|
|
28
|
+
export declare function createDataProperty<T extends object>(target: T, name: string | symbol, value: any): void;
|
|
22
29
|
export declare const UNICODE_EXTENSION_SEQUENCE_REGEX: RegExp;
|
|
23
30
|
export declare function invariant(condition: boolean, message: string, Err?: any): asserts condition;
|
package/lib/utils.js
CHANGED
|
@@ -69,6 +69,20 @@ export function defineProperty(target, name, _a) {
|
|
|
69
69
|
value: value,
|
|
70
70
|
});
|
|
71
71
|
}
|
|
72
|
+
/**
|
|
73
|
+
* 7.3.5 CreateDataProperty
|
|
74
|
+
* @param target
|
|
75
|
+
* @param name
|
|
76
|
+
* @param value
|
|
77
|
+
*/
|
|
78
|
+
export function createDataProperty(target, name, value) {
|
|
79
|
+
Object.defineProperty(target, name, {
|
|
80
|
+
configurable: true,
|
|
81
|
+
enumerable: true,
|
|
82
|
+
writable: true,
|
|
83
|
+
value: value,
|
|
84
|
+
});
|
|
85
|
+
}
|
|
72
86
|
export var UNICODE_EXTENSION_SEQUENCE_REGEX = /-u(?:-[0-9a-z]{2,8})+/gi;
|
|
73
87
|
export function invariant(condition, message, Err) {
|
|
74
88
|
if (Err === void 0) { Err = Error; }
|
package/package.json
CHANGED
package/types/number.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { LDMLPluralRule } from './plural-rules';
|
|
2
1
|
import { LocaleData } from './core';
|
|
2
|
+
import { LDMLPluralRule } from './plural-rules';
|
|
3
3
|
export type NumberFormatNotation = 'standard' | 'scientific' | 'engineering' | 'compact';
|
|
4
4
|
export type RoundingPriorityType = 'auto' | 'morePrecision' | 'lessPrecision';
|
|
5
5
|
export type NumberFormatRoundingType = 'morePrecision' | 'lessPrecision' | 'significantDigits' | 'fractionDigits';
|
|
@@ -87,6 +87,8 @@ export interface SymbolsData {
|
|
|
87
87
|
timeSeparator: string;
|
|
88
88
|
approximatelySign: string;
|
|
89
89
|
rangeSign: string;
|
|
90
|
+
currencyGroup?: string;
|
|
91
|
+
currencyDecimal?: string;
|
|
90
92
|
}
|
|
91
93
|
export interface RawNumberData {
|
|
92
94
|
nu: string[];
|
package/utils.d.ts
CHANGED
|
@@ -19,5 +19,12 @@ export declare function isLiteralPart(patternPart: LiteralPart | {
|
|
|
19
19
|
export declare function defineProperty<T extends object>(target: T, name: string | symbol, { value }: {
|
|
20
20
|
value: any;
|
|
21
21
|
} & ThisType<any>): void;
|
|
22
|
+
/**
|
|
23
|
+
* 7.3.5 CreateDataProperty
|
|
24
|
+
* @param target
|
|
25
|
+
* @param name
|
|
26
|
+
* @param value
|
|
27
|
+
*/
|
|
28
|
+
export declare function createDataProperty<T extends object>(target: T, name: string | symbol, value: any): void;
|
|
22
29
|
export declare const UNICODE_EXTENSION_SEQUENCE_REGEX: RegExp;
|
|
23
30
|
export declare function invariant(condition: boolean, message: string, Err?: any): asserts condition;
|
package/utils.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.invariant = exports.UNICODE_EXTENSION_SEQUENCE_REGEX = exports.defineProperty = exports.isLiteralPart = exports.getMultiInternalSlots = exports.getInternalSlot = exports.setMultiInternalSlots = exports.setInternalSlot = exports.repeat = exports.getMagnitude = void 0;
|
|
3
|
+
exports.invariant = exports.UNICODE_EXTENSION_SEQUENCE_REGEX = exports.createDataProperty = exports.defineProperty = exports.isLiteralPart = exports.getMultiInternalSlots = exports.getInternalSlot = exports.setMultiInternalSlots = exports.setInternalSlot = exports.repeat = exports.getMagnitude = void 0;
|
|
4
4
|
/**
|
|
5
5
|
* Cannot do Math.log(x) / Math.log(10) bc if IEEE floating point issue
|
|
6
6
|
* @param x number
|
|
@@ -80,6 +80,21 @@ function defineProperty(target, name, _a) {
|
|
|
80
80
|
});
|
|
81
81
|
}
|
|
82
82
|
exports.defineProperty = defineProperty;
|
|
83
|
+
/**
|
|
84
|
+
* 7.3.5 CreateDataProperty
|
|
85
|
+
* @param target
|
|
86
|
+
* @param name
|
|
87
|
+
* @param value
|
|
88
|
+
*/
|
|
89
|
+
function createDataProperty(target, name, value) {
|
|
90
|
+
Object.defineProperty(target, name, {
|
|
91
|
+
configurable: true,
|
|
92
|
+
enumerable: true,
|
|
93
|
+
writable: true,
|
|
94
|
+
value: value,
|
|
95
|
+
});
|
|
96
|
+
}
|
|
97
|
+
exports.createDataProperty = createDataProperty;
|
|
83
98
|
exports.UNICODE_EXTENSION_SEQUENCE_REGEX = /-u(?:-[0-9a-z]{2,8})+/gi;
|
|
84
99
|
function invariant(condition, message, Err) {
|
|
85
100
|
if (Err === void 0) { Err = Error; }
|