-
-
Notifications
You must be signed in to change notification settings - Fork 99
chore: release v11.0.18 #295
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -3,7 +3,7 @@ | |
| * | ||
| * @copyright 2026 Jason Mulligan <jason.mulligan@avoidwork.com> | ||
| * @license BSD-3-Clause | ||
| * @version 11.0.17 | ||
| * @version 11.0.18 | ||
| */ | ||
| // Error Messages | ||
| const INVALID_NUMBER = "Invalid number"; | ||
|
|
@@ -286,26 +286,31 @@ function applyPrecisionHandling( | |
| function applyNumberFormatting(value, locale, localeOptions, separator, pad, round) { | ||
| let result = value; | ||
|
|
||
| // When padding alongside a locale, let the locale formatter emit the fixed | ||
| // number of fraction digits. The manual string padding below cannot tell a | ||
| // locale-inserted grouping separator from the decimal separator, so it | ||
| // dropped digits (e.g. "1,234,500" became "1,234"). | ||
| const localePad = | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. dist/filesize.js:293 — Severity: medium Other Locations
🤖 Was this useful? React with 👍 or 👎, or 🚀 if it prevented an incident/outage. |
||
| pad && round > 0 ? { minimumFractionDigits: round, maximumFractionDigits: round } : undefined; | ||
|
|
||
| // Apply locale formatting | ||
| if (locale === true) { | ||
| result = result.toLocaleString(); | ||
| result = result.toLocaleString(undefined, localePad); | ||
| } else if (locale.length > 0) { | ||
| result = result.toLocaleString(locale, localeOptions); | ||
| result = result.toLocaleString(locale, { ...localeOptions, ...localePad }); | ||
| } else if (separator.length > 0) { | ||
| result = result.toString().replace(PERIOD, separator); | ||
| } | ||
|
|
||
| // Apply padding | ||
| if (pad && round > 0) { | ||
| // Apply padding for the non-locale paths, where the string has a single | ||
| // decimal separator and no grouping is inserted. | ||
| if (pad && round > 0 && locale !== true && locale.length === 0) { | ||
| const resultStr = result.toString(); | ||
| const x = separator || (resultStr.slice(1).match(/[.,]/g) || []).pop() || PERIOD; | ||
| const x = separator || PERIOD; | ||
| const tmp = resultStr.split(x); | ||
| const s = tmp[1] || EMPTY; | ||
|
|
||
| const l = s.length; | ||
| const n = round - l; | ||
|
|
||
| result = `${tmp[0]}${x}${s.padEnd(l + n, ZERO)}`; | ||
| result = `${tmp[0]}${x}${s.padEnd(round, ZERO)}`; | ||
| } | ||
|
|
||
| return result; | ||
|
|
||
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Large diffs are not rendered by default.
Uh oh!
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
CHANGELOG.md:7 — The compare link for
11.0.18points to11.0.16...11.0.18; is it intentional to skip11.0.17here? If11.0.17was released/tagged, this link may be misleading for readers.Severity: low
🤖 Was this useful? React with 👍 or 👎, or 🚀 if it prevented an incident/outage.