@internationalized/number
Advanced tools
Comparing version 3.0.0-nightly-fb28ab3b4-241024 to 3.0.0-nightly-fee532d6a-241217
@@ -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); |
@@ -24,3 +24,5 @@ var $0c1d5654b62fc485$exports = require("./NumberFormatter.main.js"); | ||
'arab', | ||
'hanidec' | ||
'hanidec', | ||
'deva', | ||
'beng' | ||
]; | ||
@@ -207,3 +209,2 @@ class $d68f3f4c684426c6$export$cd11ab140839f11d { | ||
// 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 = '+'; | ||
@@ -253,5 +254,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); | ||
@@ -258,0 +257,0 @@ } |
@@ -18,3 +18,5 @@ import {NumberFormatter as $488c6ddbf4ef74c2$export$cc77c4ff7e8673c5} from "./NumberFormatter.module.js"; | ||
'arab', | ||
'hanidec' | ||
'hanidec', | ||
'deva', | ||
'beng' | ||
]; | ||
@@ -201,3 +203,2 @@ class $6c7bd7858deea686$export$cd11ab140839f11d { | ||
// 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 = '+'; | ||
@@ -247,5 +248,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); | ||
@@ -252,0 +251,0 @@ } |
{ | ||
"name": "@internationalized/number", | ||
"version": "3.0.0-nightly-fb28ab3b4-241024", | ||
"version": "3.0.0-nightly-fee532d6a-241217", | ||
"description": "Internationalized number formatting and parsing utilities", | ||
@@ -29,4 +29,3 @@ "license": "Apache-2.0", | ||
"access": "public" | ||
}, | ||
"stableVersion": "3.5.4" | ||
} | ||
} |
@@ -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 @@ } |
@@ -26,3 +26,3 @@ /* | ||
const CURRENCY_SIGN_REGEX = new RegExp('^.*\\(.*\\).*$'); | ||
const NUMBERING_SYSTEMS = ['latn', 'arab', 'hanidec']; | ||
const NUMBERING_SYSTEMS = ['latn', 'arab', 'hanidec', 'deva', 'beng']; | ||
@@ -277,3 +277,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')) { | ||
@@ -310,5 +309,3 @@ plusSign = '+'; | ||
function replaceAll(str: string, find: string, replace: string) { | ||
// @ts-ignore | ||
if (str.replaceAll) { | ||
// @ts-ignore | ||
return str.replaceAll(find, replace); | ||
@@ -315,0 +312,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
169898
1770