Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This Pr Covers test for utils.js...
Functions Covered by the Test(This PR):
toTitleCase: Tests converting the first character of a string to uppercase and handling non-string input.
fileExt: Tests extracting the file extension from various filenames, including those without extensions or null input.
fileBasename: Tests retrieving the basename of a file path (without the extension) and handling filenames without extensions.
last: Tests returning the last element of an array or null for empty arrays.
safeSVG: Tests escaping certain HTML entities in strings and returns non-string inputs as-is.
toFixed2: Tests formatting numbers to two decimal places when needed, and returning non-number inputs unchanged.
mixedNumber: Tests converting floating-point numbers to mixed fractions and handling integer values.
nearestBeat: Tests finding the closest beat (fraction) for a given number.
oneHundredToFraction: Tests mapping numbers (1-100) to predefined fractions.
rationalToFraction: Tests converting floating-point numbers into approximate fractional representations, including special cases like 0, NaN, and Infinity.
rgbToHex: Tests converting RGB color values to their hexadecimal string representation.
hexToRGB: Tests converting a hexadecimal color code into an RGB object, including invalid hex input handling.
hex2rgb: Tests converting a hex string into an RGBA string format.