Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 10 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,18 @@ All notable changes to this project will be documented in this file. Dates are d

Generated by [`auto-changelog`](https://github.com/CookPete/auto-changelog).

#### [11.0.32](https://github.com/avoidwork/filesize.js/compare/11.0.31...11.0.32)

- fix: accept uppercase spellings of the standard option [`#403`](https://github.com/avoidwork/filesize.js/pull/403)
- chore(deps-dev): bump oxlint from 1.92.0 to 1.93.0 [`#411`](https://github.com/avoidwork/filesize.js/pull/411)
- chore(deps-dev): bump rollup from 4.68.0 to 4.68.2 [`#410`](https://github.com/avoidwork/filesize.js/pull/410)
- chore(deps-dev): bump oxfmt from 0.77.0 to 0.78.0 [`#409`](https://github.com/avoidwork/filesize.js/pull/409)

#### [11.0.31](https://github.com/avoidwork/filesize.js/compare/11.0.30...11.0.31)

> 12 November 2026

- chore: release v11.0.31 [`#408`](https://github.com/avoidwork/filesize.js/pull/408)
- fix: apply precision before round for decimal units [`#404`](https://github.com/avoidwork/filesize.js/pull/404)
- chore(deps-dev): bump oxfmt from 0.76.0 to 0.77.0 [`#407`](https://github.com/avoidwork/filesize.js/pull/407)
- chore(deps-dev): bump rollup from 4.67.5 to 4.68.0 [`#406`](https://github.com/avoidwork/filesize.js/pull/406)
Expand Down
10 changes: 9 additions & 1 deletion dist/filesize.cjs
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
*
* @copyright 2026 Jason Mulligan <jason.mulligan@avoidwork.com>
* @license BSD-3-Clause
* @version 11.0.31
* @version 11.0.32
*/
'use strict';

Expand Down Expand Up @@ -105,6 +105,14 @@ const STANDARD_CONFIGS = {
* @returns {Object} Configuration object
*/
function getBaseConfiguration(standard, base) {
// Case-normalize: the JSDoc advertises "SI, IEC, JEDEC", but the lookup
// keys are lowercase; a wrong-case spelling of a valid standard must not
// silently fall back to a different unit system. The parameter is a string
// by contract (the caller destructures a "" default), so a non-string is
// invalid input and fails fast right here. Unknown values keep the
// existing fallback behavior.
standard = standard.toLowerCase();

// Use cached lookup table for better performance
if (STANDARD_CONFIGS[standard]) {
return STANDARD_CONFIGS[standard];
Expand Down
10 changes: 9 additions & 1 deletion dist/filesize.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
*
* @copyright 2026 Jason Mulligan <jason.mulligan@avoidwork.com>
* @license BSD-3-Clause
* @version 11.0.31
* @version 11.0.32
*/
// Error Messages
const INVALID_NUMBER = "Invalid number";
Expand Down Expand Up @@ -101,6 +101,14 @@ const STANDARD_CONFIGS = {
* @returns {Object} Configuration object
*/
function getBaseConfiguration(standard, base) {
// Case-normalize: the JSDoc advertises "SI, IEC, JEDEC", but the lookup
// keys are lowercase; a wrong-case spelling of a valid standard must not
// silently fall back to a different unit system. The parameter is a string
// by contract (the caller destructures a "" default), so a non-string is
// invalid input and fails fast right here. Unknown values keep the
// existing fallback behavior.
standard = standard.toLowerCase();

// Use cached lookup table for better performance
if (STANDARD_CONFIGS[standard]) {
return STANDARD_CONFIGS[standard];
Expand Down
4 changes: 2 additions & 2 deletions dist/filesize.min.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion dist/filesize.min.js.map

Large diffs are not rendered by default.

10 changes: 9 additions & 1 deletion dist/filesize.umd.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
*
* @copyright 2026 Jason Mulligan <jason.mulligan@avoidwork.com>
* @license BSD-3-Clause
* @version 11.0.31
* @version 11.0.32
*/
(function(g,f){typeof exports==='object'&&typeof module!=='undefined'?f(exports):typeof define==='function'&&define.amd?define(['exports'],f):(g=typeof globalThis!=='undefined'?globalThis:g||self,f(g.filesize={}));})(this,(function(exports){'use strict';// Error Messages
const INVALID_NUMBER = "Invalid number";
Expand Down Expand Up @@ -101,6 +101,14 @@ const STANDARD_CONFIGS = {
* @returns {Object} Configuration object
*/
function getBaseConfiguration(standard, base) {
// Case-normalize: the JSDoc advertises "SI, IEC, JEDEC", but the lookup
// keys are lowercase; a wrong-case spelling of a valid standard must not
// silently fall back to a different unit system. The parameter is a string
// by contract (the caller destructures a "" default), so a non-string is
// invalid input and fails fast right here. Unknown values keep the
// existing fallback behavior.
standard = standard.toLowerCase();

// Use cached lookup table for better performance
if (STANDARD_CONFIGS[standard]) {
return STANDARD_CONFIGS[standard];
Expand Down
Loading
Loading