Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@formatjs/ecma402-abstract

Package Overview
Dependencies
Maintainers
3
Versions
72
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 1.13.0 to 1.14.0

lib/NumberFormat/FormatNumericRange.d.ts

2

index.d.ts

@@ -18,2 +18,4 @@ export * from './CanonicalizeLocaleList';

export * from './NumberFormat/FormatApproximately';
export * from './NumberFormat/FormatNumericRange';
export * from './NumberFormat/FormatNumericRangeToParts';
export * from './NumberFormat/FormatNumericToParts';

@@ -20,0 +22,0 @@ export * from './NumberFormat/FormatNumericToString';

@@ -22,2 +22,4 @@ "use strict";

tslib_1.__exportStar(require("./NumberFormat/FormatApproximately"), exports);
tslib_1.__exportStar(require("./NumberFormat/FormatNumericRange"), exports);
tslib_1.__exportStar(require("./NumberFormat/FormatNumericRangeToParts"), exports);
tslib_1.__exportStar(require("./NumberFormat/FormatNumericToParts"), exports);

@@ -24,0 +26,0 @@ tslib_1.__exportStar(require("./NumberFormat/FormatNumericToString"), exports);

@@ -18,2 +18,4 @@ export * from './CanonicalizeLocaleList';

export * from './NumberFormat/FormatApproximately';
export * from './NumberFormat/FormatNumericRange';
export * from './NumberFormat/FormatNumericRangeToParts';
export * from './NumberFormat/FormatNumericToParts';

@@ -20,0 +22,0 @@ export * from './NumberFormat/FormatNumericToString';

@@ -18,2 +18,4 @@ export * from './CanonicalizeLocaleList';

export * from './NumberFormat/FormatApproximately';
export * from './NumberFormat/FormatNumericRange';
export * from './NumberFormat/FormatNumericRangeToParts';
export * from './NumberFormat/FormatNumericToParts';

@@ -20,0 +22,0 @@ export * from './NumberFormat/FormatNumericToString';

30

lib/NumberFormat/PartitionNumberRangePattern.js

@@ -1,2 +0,1 @@

import { SameValue } from '../262';
import { PartitionNumberPattern } from './PartitionNumberPattern';

@@ -10,30 +9,5 @@ import { CollapseNumberRange } from './CollapseNumberRange';

var getInternalSlots = _a.getInternalSlots;
var internalSlots = getInternalSlots(numberFormat);
if (isNaN(x) || isNaN(y)) {
throw new RangeError('Input must be a number');
}
if (isFinite(x)) {
if (isFinite(y) && y < x) {
throw new RangeError('Y input must be bigger than X');
}
else if (y == Number.NEGATIVE_INFINITY) {
throw new RangeError('Y input must not be NegativeInfinity');
}
else if (SameValue(y, -0) && x >= 0) {
throw new RangeError('Y input must be bigger than X');
}
}
else if (x == Number.POSITIVE_INFINITY) {
if (isFinite(y) || y == Number.NEGATIVE_INFINITY || SameValue(y, -0)) {
throw new RangeError('Y input must be bigger than X');
}
}
else if (SameValue(x, -0)) {
if (isFinite(y) && y < 0) {
throw new RangeError('Y input must be bigger than X');
}
else if (y == Number.NEGATIVE_INFINITY) {
throw new RangeError('Y input must be bigger than X');
}
}
var result = [];

@@ -50,5 +24,5 @@ var xResult = PartitionNumberPattern(numberFormat, x, { getInternalSlots: getInternalSlots });

result = result.concat(xResult);
var internalSlots = getInternalSlots(numberFormat);
var symbols = internalSlots.dataLocaleData.numbers.symbols[internalSlots.numberingSystem];
var rangeSeparator = symbols.timeSeparator;
result.push({ type: 'literal', value: rangeSeparator, source: 'shared' });
result.push({ type: 'literal', value: symbols.rangeSign, source: 'shared' });
for (var _b = 0, yResult_1 = yResult; _b < yResult_1.length; _b++) {

@@ -55,0 +29,0 @@ var r = yResult_1[_b];

@@ -6,2 +6,4 @@ import { LocaleData } from './core';

declare type CurrencyCode = string;
declare type CalendarCode = string;
declare type DateTimeFieldCode = string;
export interface DisplayNamesData {

@@ -17,5 +19,12 @@ /**

language: {
narrow: Record<LanguageTag, string>;
short: Record<LanguageTag, string>;
long: Record<LanguageTag, string>;
dialect: {
narrow: Record<LanguageTag, string>;
short: Record<LanguageTag, string>;
long: Record<LanguageTag, string>;
};
standard: {
narrow: Record<LanguageTag, string>;
short: Record<LanguageTag, string>;
long: Record<LanguageTag, string>;
};
};

@@ -37,2 +46,12 @@ region: {

};
calendar: {
narrow: Record<CalendarCode, string>;
short: Record<CalendarCode, string>;
long: Record<CalendarCode, string>;
};
dateTimeField: {
narrow: Record<DateTimeFieldCode, string>;
short: Record<DateTimeFieldCode, string>;
long: Record<DateTimeFieldCode, string>;
};
};

@@ -39,0 +58,0 @@ /**

@@ -89,2 +89,3 @@ import { LDMLPluralRule } from './plural-rules';

approximatelySign: string;
rangeSign: string;
}

@@ -162,2 +163,5 @@ export interface RawNumberData {

}
export interface NumberRangeToParts extends NumberFormatPart {
result: string;
}
//# sourceMappingURL=number.d.ts.map
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.PartitionNumberRangePattern = void 0;
var _262_1 = require("../262");
var PartitionNumberPattern_1 = require("./PartitionNumberPattern");

@@ -13,30 +12,5 @@ var CollapseNumberRange_1 = require("./CollapseNumberRange");

var getInternalSlots = _a.getInternalSlots;
var internalSlots = getInternalSlots(numberFormat);
if (isNaN(x) || isNaN(y)) {
throw new RangeError('Input must be a number');
}
if (isFinite(x)) {
if (isFinite(y) && y < x) {
throw new RangeError('Y input must be bigger than X');
}
else if (y == Number.NEGATIVE_INFINITY) {
throw new RangeError('Y input must not be NegativeInfinity');
}
else if ((0, _262_1.SameValue)(y, -0) && x >= 0) {
throw new RangeError('Y input must be bigger than X');
}
}
else if (x == Number.POSITIVE_INFINITY) {
if (isFinite(y) || y == Number.NEGATIVE_INFINITY || (0, _262_1.SameValue)(y, -0)) {
throw new RangeError('Y input must be bigger than X');
}
}
else if ((0, _262_1.SameValue)(x, -0)) {
if (isFinite(y) && y < 0) {
throw new RangeError('Y input must be bigger than X');
}
else if (y == Number.NEGATIVE_INFINITY) {
throw new RangeError('Y input must be bigger than X');
}
}
var result = [];

@@ -53,5 +27,5 @@ var xResult = (0, PartitionNumberPattern_1.PartitionNumberPattern)(numberFormat, x, { getInternalSlots: getInternalSlots });

result = result.concat(xResult);
var internalSlots = getInternalSlots(numberFormat);
var symbols = internalSlots.dataLocaleData.numbers.symbols[internalSlots.numberingSystem];
var rangeSeparator = symbols.timeSeparator;
result.push({ type: 'literal', value: rangeSeparator, source: 'shared' });
result.push({ type: 'literal', value: symbols.rangeSign, source: 'shared' });
for (var _b = 0, yResult_1 = yResult; _b < yResult_1.length; _b++) {

@@ -58,0 +32,0 @@ var r = yResult_1[_b];

{
"name": "@formatjs/ecma402-abstract",
"version": "1.13.0",
"version": "1.14.0",
"description": "A collection of implementation for ECMAScript abstract operations",

@@ -5,0 +5,0 @@ "keywords": [

@@ -6,2 +6,4 @@ import { LocaleData } from './core';

declare type CurrencyCode = string;
declare type CalendarCode = string;
declare type DateTimeFieldCode = string;
export interface DisplayNamesData {

@@ -17,5 +19,12 @@ /**

language: {
narrow: Record<LanguageTag, string>;
short: Record<LanguageTag, string>;
long: Record<LanguageTag, string>;
dialect: {
narrow: Record<LanguageTag, string>;
short: Record<LanguageTag, string>;
long: Record<LanguageTag, string>;
};
standard: {
narrow: Record<LanguageTag, string>;
short: Record<LanguageTag, string>;
long: Record<LanguageTag, string>;
};
};

@@ -37,2 +46,12 @@ region: {

};
calendar: {
narrow: Record<CalendarCode, string>;
short: Record<CalendarCode, string>;
long: Record<CalendarCode, string>;
};
dateTimeField: {
narrow: Record<DateTimeFieldCode, string>;
short: Record<DateTimeFieldCode, string>;
long: Record<DateTimeFieldCode, string>;
};
};

@@ -39,0 +58,0 @@ /**

@@ -89,2 +89,3 @@ import { LDMLPluralRule } from './plural-rules';

approximatelySign: string;
rangeSign: string;
}

@@ -162,2 +163,5 @@ export interface RawNumberData {

}
export interface NumberRangeToParts extends NumberFormatPart {
result: string;
}
//# sourceMappingURL=number.d.ts.map

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc