@internationalized/number
Advanced tools
Comparing version 3.0.0-nightly-7aa6265a2-241113 to 3.0.0-nightly-7eae25e12-241205
@@ -20,3 +20,2 @@ | ||
try { | ||
// @ts-ignore | ||
$0c1d5654b62fc485$var$supportsSignDisplay = new Intl.NumberFormat('de-DE', { | ||
@@ -29,3 +28,2 @@ signDisplay: 'exceptZero' | ||
try { | ||
// @ts-ignore | ||
$0c1d5654b62fc485$var$supportsUnit = new Intl.NumberFormat('de-DE', { | ||
@@ -66,9 +64,6 @@ style: 'unit', | ||
// TODO: implement signDisplay for formatToParts | ||
// @ts-ignore | ||
return this.numberFormatter.formatToParts(value); | ||
} | ||
/** Formats a number range as a string. */ formatRange(start, end) { | ||
// @ts-ignore | ||
if (typeof this.numberFormatter.formatRange === 'function') // @ts-ignore | ||
return this.numberFormatter.formatRange(start, end); | ||
if (typeof this.numberFormatter.formatRange === 'function') return this.numberFormatter.formatRange(start, end); | ||
if (end < start) throw new RangeError('End date must be >= start date'); | ||
@@ -79,5 +74,3 @@ // Very basic fallback for old browsers. | ||
/** Formats a number range as an array of parts. */ formatRangeToParts(start, end) { | ||
// @ts-ignore | ||
if (typeof this.numberFormatter.formatRangeToParts === 'function') // @ts-ignore | ||
return this.numberFormatter.formatRangeToParts(start, end); | ||
if (typeof this.numberFormatter.formatRangeToParts === 'function') return this.numberFormatter.formatRangeToParts(start, end); | ||
if (end < start) throw new RangeError('End date must be >= start date'); | ||
@@ -84,0 +77,0 @@ let startParts = this.numberFormatter.formatToParts(start); |
@@ -14,3 +14,2 @@ /* | ||
try { | ||
// @ts-ignore | ||
$488c6ddbf4ef74c2$var$supportsSignDisplay = new Intl.NumberFormat('de-DE', { | ||
@@ -23,3 +22,2 @@ signDisplay: 'exceptZero' | ||
try { | ||
// @ts-ignore | ||
$488c6ddbf4ef74c2$var$supportsUnit = new Intl.NumberFormat('de-DE', { | ||
@@ -60,9 +58,6 @@ style: 'unit', | ||
// TODO: implement signDisplay for formatToParts | ||
// @ts-ignore | ||
return this.numberFormatter.formatToParts(value); | ||
} | ||
/** Formats a number range as a string. */ formatRange(start, end) { | ||
// @ts-ignore | ||
if (typeof this.numberFormatter.formatRange === 'function') // @ts-ignore | ||
return this.numberFormatter.formatRange(start, end); | ||
if (typeof this.numberFormatter.formatRange === 'function') return this.numberFormatter.formatRange(start, end); | ||
if (end < start) throw new RangeError('End date must be >= start date'); | ||
@@ -73,5 +68,3 @@ // Very basic fallback for old browsers. | ||
/** Formats a number range as an array of parts. */ formatRangeToParts(start, end) { | ||
// @ts-ignore | ||
if (typeof this.numberFormatter.formatRangeToParts === 'function') // @ts-ignore | ||
return this.numberFormatter.formatRangeToParts(start, end); | ||
if (typeof this.numberFormatter.formatRangeToParts === 'function') return this.numberFormatter.formatRangeToParts(start, end); | ||
if (end < start) throw new RangeError('End date must be >= start date'); | ||
@@ -78,0 +71,0 @@ let startParts = this.numberFormatter.formatToParts(start); |
@@ -208,3 +208,2 @@ var $0c1d5654b62fc485$exports = require("./NumberFormatter.main.js"); | ||
// If no plus sign was returned, but the original options contained signDisplay, default to the '+' character. | ||
// @ts-ignore | ||
if (!plusSign && ((originalOptions === null || originalOptions === void 0 ? void 0 : originalOptions.signDisplay) === 'exceptZero' || (originalOptions === null || originalOptions === void 0 ? void 0 : originalOptions.signDisplay) === 'always')) plusSign = '+'; | ||
@@ -254,5 +253,3 @@ // If maximumSignificantDigits is 1 (the minimum) then we won't get decimal characters out of the above formatters | ||
function $d68f3f4c684426c6$var$replaceAll(str, find, replace) { | ||
// @ts-ignore | ||
if (str.replaceAll) // @ts-ignore | ||
return str.replaceAll(find, replace); | ||
if (str.replaceAll) return str.replaceAll(find, replace); | ||
return str.split(find).join(replace); | ||
@@ -259,0 +256,0 @@ } |
@@ -202,3 +202,2 @@ import {NumberFormatter as $488c6ddbf4ef74c2$export$cc77c4ff7e8673c5} from "./NumberFormatter.module.js"; | ||
// If no plus sign was returned, but the original options contained signDisplay, default to the '+' character. | ||
// @ts-ignore | ||
if (!plusSign && ((originalOptions === null || originalOptions === void 0 ? void 0 : originalOptions.signDisplay) === 'exceptZero' || (originalOptions === null || originalOptions === void 0 ? void 0 : originalOptions.signDisplay) === 'always')) plusSign = '+'; | ||
@@ -248,5 +247,3 @@ // If maximumSignificantDigits is 1 (the minimum) then we won't get decimal characters out of the above formatters | ||
function $6c7bd7858deea686$var$replaceAll(str, find, replace) { | ||
// @ts-ignore | ||
if (str.replaceAll) // @ts-ignore | ||
return str.replaceAll(find, replace); | ||
if (str.replaceAll) return str.replaceAll(find, replace); | ||
return str.split(find).join(replace); | ||
@@ -253,0 +250,0 @@ } |
{ | ||
"name": "@internationalized/number", | ||
"version": "3.0.0-nightly-7aa6265a2-241113", | ||
"version": "3.0.0-nightly-7eae25e12-241205", | ||
"description": "Internationalized number formatting and parsing utilities", | ||
@@ -30,3 +30,3 @@ "license": "Apache-2.0", | ||
}, | ||
"stableVersion": "3.5.4" | ||
"stableVersion": "3.6.0" | ||
} |
@@ -17,3 +17,2 @@ /* | ||
try { | ||
// @ts-ignore | ||
supportsSignDisplay = (new Intl.NumberFormat('de-DE', {signDisplay: 'exceptZero'})).resolvedOptions().signDisplay === 'exceptZero'; | ||
@@ -25,3 +24,2 @@ // eslint-disable-next-line no-empty | ||
try { | ||
// @ts-ignore | ||
supportsUnit = (new Intl.NumberFormat('de-DE', {style: 'unit', unit: 'degree'})).resolvedOptions().style === 'unit'; | ||
@@ -92,3 +90,2 @@ // eslint-disable-next-line no-empty | ||
// TODO: implement signDisplay for formatToParts | ||
// @ts-ignore | ||
return this.numberFormatter.formatToParts(value); | ||
@@ -99,5 +96,3 @@ } | ||
formatRange(start: number, end: number): string { | ||
// @ts-ignore | ||
if (typeof this.numberFormatter.formatRange === 'function') { | ||
// @ts-ignore | ||
return this.numberFormatter.formatRange(start, end); | ||
@@ -116,5 +111,3 @@ } | ||
formatRangeToParts(start: number, end: number): NumberRangeFormatPart[] { | ||
// @ts-ignore | ||
if (typeof this.numberFormatter.formatRangeToParts === 'function') { | ||
// @ts-ignore | ||
return this.numberFormatter.formatRangeToParts(start, end); | ||
@@ -121,0 +114,0 @@ } |
@@ -276,3 +276,2 @@ /* | ||
// If no plus sign was returned, but the original options contained signDisplay, default to the '+' character. | ||
// @ts-ignore | ||
if (!plusSign && (originalOptions?.signDisplay === 'exceptZero' || originalOptions?.signDisplay === 'always')) { | ||
@@ -309,5 +308,3 @@ plusSign = '+'; | ||
function replaceAll(str: string, find: string, replace: string) { | ||
// @ts-ignore | ||
if (str.replaceAll) { | ||
// @ts-ignore | ||
return str.replaceAll(find, replace); | ||
@@ -314,0 +311,0 @@ } |
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
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
169926
1770