@formatjs/ecma402-abstract
Advanced tools
Comparing version 1.18.3 to 2.0.0
@@ -33,13 +33,13 @@ export * from './CanonicalizeLocaleList'; | ||
export * from './SupportedLocales'; | ||
export { getInternalSlot, getMultiInternalSlots, isLiteralPart, setInternalSlot, setMultiInternalSlots, getMagnitude, defineProperty, } from './utils'; | ||
export { createDataProperty, defineProperty, getInternalSlot, getMagnitude, getMultiInternalSlots, isLiteralPart, setInternalSlot, setMultiInternalSlots, } from './utils'; | ||
export type { LiteralPart } from './utils'; | ||
export * from './262'; | ||
export { isMissingLocaleDataError } from './data'; | ||
export * from './types/relative-time'; | ||
export type { LocaleData } from './types/core'; | ||
export * from './types/date-time'; | ||
export * from './types/displaynames'; | ||
export * from './types/list'; | ||
export * from './types/number'; | ||
export * from './types/plural-rules'; | ||
export * from './types/number'; | ||
export * from './types/displaynames'; | ||
export * from './types/relative-time'; | ||
export { invariant } from './utils'; | ||
export type { LocaleData } from './types/core'; | ||
export * from './262'; |
15
index.js
"use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
exports.invariant = exports.isMissingLocaleDataError = exports.defineProperty = exports.getMagnitude = exports.setMultiInternalSlots = exports.setInternalSlot = exports.isLiteralPart = exports.getMultiInternalSlots = exports.getInternalSlot = exports._formatToParts = void 0; | ||
exports.invariant = exports.isMissingLocaleDataError = exports.setMultiInternalSlots = exports.setInternalSlot = exports.isLiteralPart = exports.getMultiInternalSlots = exports.getMagnitude = exports.getInternalSlot = exports.defineProperty = exports.createDataProperty = exports._formatToParts = void 0; | ||
var tslib_1 = require("tslib"); | ||
@@ -39,3 +39,6 @@ tslib_1.__exportStar(require("./CanonicalizeLocaleList"), exports); | ||
var utils_1 = require("./utils"); | ||
Object.defineProperty(exports, "createDataProperty", { enumerable: true, get: function () { return utils_1.createDataProperty; } }); | ||
Object.defineProperty(exports, "defineProperty", { enumerable: true, get: function () { return utils_1.defineProperty; } }); | ||
Object.defineProperty(exports, "getInternalSlot", { enumerable: true, get: function () { return utils_1.getInternalSlot; } }); | ||
Object.defineProperty(exports, "getMagnitude", { enumerable: true, get: function () { return utils_1.getMagnitude; } }); | ||
Object.defineProperty(exports, "getMultiInternalSlots", { enumerable: true, get: function () { return utils_1.getMultiInternalSlots; } }); | ||
@@ -45,14 +48,12 @@ Object.defineProperty(exports, "isLiteralPart", { enumerable: true, get: function () { return utils_1.isLiteralPart; } }); | ||
Object.defineProperty(exports, "setMultiInternalSlots", { enumerable: true, get: function () { return utils_1.setMultiInternalSlots; } }); | ||
Object.defineProperty(exports, "getMagnitude", { enumerable: true, get: function () { return utils_1.getMagnitude; } }); | ||
Object.defineProperty(exports, "defineProperty", { enumerable: true, get: function () { return utils_1.defineProperty; } }); | ||
tslib_1.__exportStar(require("./262"), exports); | ||
var data_1 = require("./data"); | ||
Object.defineProperty(exports, "isMissingLocaleDataError", { enumerable: true, get: function () { return data_1.isMissingLocaleDataError; } }); | ||
tslib_1.__exportStar(require("./types/relative-time"), exports); | ||
tslib_1.__exportStar(require("./types/date-time"), exports); | ||
tslib_1.__exportStar(require("./types/displaynames"), exports); | ||
tslib_1.__exportStar(require("./types/list"), exports); | ||
tslib_1.__exportStar(require("./types/number"), exports); | ||
tslib_1.__exportStar(require("./types/plural-rules"), exports); | ||
tslib_1.__exportStar(require("./types/number"), exports); | ||
tslib_1.__exportStar(require("./types/displaynames"), exports); | ||
tslib_1.__exportStar(require("./types/relative-time"), exports); | ||
var utils_2 = require("./utils"); | ||
Object.defineProperty(exports, "invariant", { enumerable: true, get: function () { return utils_2.invariant; } }); | ||
tslib_1.__exportStar(require("./262"), exports); |
@@ -33,13 +33,13 @@ export * from './CanonicalizeLocaleList'; | ||
export * from './SupportedLocales'; | ||
export { getInternalSlot, getMultiInternalSlots, isLiteralPart, setInternalSlot, setMultiInternalSlots, getMagnitude, defineProperty, } from './utils'; | ||
export { createDataProperty, defineProperty, getInternalSlot, getMagnitude, getMultiInternalSlots, isLiteralPart, setInternalSlot, setMultiInternalSlots, } from './utils'; | ||
export type { LiteralPart } from './utils'; | ||
export * from './262'; | ||
export { isMissingLocaleDataError } from './data'; | ||
export * from './types/relative-time'; | ||
export type { LocaleData } from './types/core'; | ||
export * from './types/date-time'; | ||
export * from './types/displaynames'; | ||
export * from './types/list'; | ||
export * from './types/number'; | ||
export * from './types/plural-rules'; | ||
export * from './types/number'; | ||
export * from './types/displaynames'; | ||
export * from './types/relative-time'; | ||
export { invariant } from './utils'; | ||
export type { LocaleData } from './types/core'; | ||
export * from './262'; |
@@ -33,11 +33,11 @@ export * from './CanonicalizeLocaleList'; | ||
export * from './SupportedLocales'; | ||
export { getInternalSlot, getMultiInternalSlots, isLiteralPart, setInternalSlot, setMultiInternalSlots, getMagnitude, defineProperty, } from './utils'; | ||
export { createDataProperty, defineProperty, getInternalSlot, getMagnitude, getMultiInternalSlots, isLiteralPart, setInternalSlot, setMultiInternalSlots, } from './utils'; | ||
export * from './262'; | ||
export { isMissingLocaleDataError } from './data'; | ||
export * from './types/relative-time'; | ||
export * from './types/date-time'; | ||
export * from './types/displaynames'; | ||
export * from './types/list'; | ||
export * from './types/number'; | ||
export * from './types/plural-rules'; | ||
export * from './types/number'; | ||
export * from './types/displaynames'; | ||
export * from './types/relative-time'; | ||
export { invariant } from './utils'; | ||
export * from './262'; |
@@ -343,3 +343,6 @@ import { S_UNICODE_REGEX } from '../regex.generated'; | ||
if (fraction !== undefined) { | ||
result.push({ type: 'decimal', value: symbols.decimal }, { type: 'fraction', value: fraction }); | ||
var decimalSepSymbol = style === 'currency' && symbols.currencyDecimal != null | ||
? symbols.currencyDecimal | ||
: symbols.decimal; | ||
result.push({ type: 'decimal', value: decimalSepSymbol }, { type: 'fraction', value: fraction }); | ||
} | ||
@@ -346,0 +349,0 @@ if ((notation === 'scientific' || notation === 'engineering') && |
@@ -91,2 +91,3 @@ import { LocaleData } from './core'; | ||
currencyGroup?: string; | ||
currencyDecimal?: string; | ||
} | ||
@@ -93,0 +94,0 @@ export interface RawNumberData { |
@@ -22,3 +22,10 @@ /** | ||
} & ThisType<any>): void; | ||
/** | ||
* 7.3.5 CreateDataProperty | ||
* @param target | ||
* @param name | ||
* @param value | ||
*/ | ||
export declare function createDataProperty<T extends object>(target: T, name: string | symbol, value: any): void; | ||
export declare const UNICODE_EXTENSION_SEQUENCE_REGEX: RegExp; | ||
export declare function invariant(condition: boolean, message: string, Err?: any): asserts condition; |
@@ -72,2 +72,16 @@ /** | ||
} | ||
/** | ||
* 7.3.5 CreateDataProperty | ||
* @param target | ||
* @param name | ||
* @param value | ||
*/ | ||
export function createDataProperty(target, name, value) { | ||
Object.defineProperty(target, name, { | ||
configurable: true, | ||
enumerable: true, | ||
writable: true, | ||
value: value, | ||
}); | ||
} | ||
export var UNICODE_EXTENSION_SEQUENCE_REGEX = /-u(?:-[0-9a-z]{2,8})+/gi; | ||
@@ -74,0 +88,0 @@ export function invariant(condition, message, Err) { |
@@ -346,3 +346,6 @@ "use strict"; | ||
if (fraction !== undefined) { | ||
result.push({ type: 'decimal', value: symbols.decimal }, { type: 'fraction', value: fraction }); | ||
var decimalSepSymbol = style === 'currency' && symbols.currencyDecimal != null | ||
? symbols.currencyDecimal | ||
: symbols.decimal; | ||
result.push({ type: 'decimal', value: decimalSepSymbol }, { type: 'fraction', value: fraction }); | ||
} | ||
@@ -349,0 +352,0 @@ if ((notation === 'scientific' || notation === 'engineering') && |
{ | ||
"name": "@formatjs/ecma402-abstract", | ||
"version": "1.18.3", | ||
"version": "2.0.0", | ||
"description": "A collection of implementation for ECMAScript abstract operations", | ||
@@ -5,0 +5,0 @@ "keywords": [ |
@@ -91,2 +91,3 @@ import { LocaleData } from './core'; | ||
currencyGroup?: string; | ||
currencyDecimal?: string; | ||
} | ||
@@ -93,0 +94,0 @@ export interface RawNumberData { |
@@ -22,3 +22,10 @@ /** | ||
} & ThisType<any>): void; | ||
/** | ||
* 7.3.5 CreateDataProperty | ||
* @param target | ||
* @param name | ||
* @param value | ||
*/ | ||
export declare function createDataProperty<T extends object>(target: T, name: string | symbol, value: any): void; | ||
export declare const UNICODE_EXTENSION_SEQUENCE_REGEX: RegExp; | ||
export declare function invariant(condition: boolean, message: string, Err?: any): asserts condition; |
17
utils.js
"use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
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; | ||
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; | ||
/** | ||
@@ -83,2 +83,17 @@ * Cannot do Math.log(x) / Math.log(10) bc if IEEE floating point issue | ||
exports.defineProperty = defineProperty; | ||
/** | ||
* 7.3.5 CreateDataProperty | ||
* @param target | ||
* @param name | ||
* @param value | ||
*/ | ||
function createDataProperty(target, name, value) { | ||
Object.defineProperty(target, name, { | ||
configurable: true, | ||
enumerable: true, | ||
writable: true, | ||
value: value, | ||
}); | ||
} | ||
exports.createDataProperty = createDataProperty; | ||
exports.UNICODE_EXTENSION_SEQUENCE_REGEX = /-u(?:-[0-9a-z]{2,8})+/gi; | ||
@@ -85,0 +100,0 @@ function invariant(condition, message, Err) { |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
256983
7485