Skip to content

Commit

Permalink
Update typescript and fix ts errors
Browse files Browse the repository at this point in the history
  • Loading branch information
piotrkulpinski committed Dec 1, 2023
1 parent 2fabbab commit e950ed8
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 7 deletions.
Binary file modified bun.lockb
Binary file not shown.
6 changes: 3 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "@curiousleaf/utils",
"description": "A lightweight set of utilities",
"version": "1.0.4",
"version": "1.0.5",
"license": "MIT",
"module": "./dist/index.js",
"type": "module",
Expand All @@ -20,6 +20,6 @@
"devDependencies": {
"@biomejs/biome": "latest",
"bun-types": "latest",
"typescript": "latest"
"typescript": "^5.3.2"
}
}
}
8 changes: 4 additions & 4 deletions src/format/format.ts
Original file line number Diff line number Diff line change
Expand Up @@ -66,16 +66,16 @@ export const formatBytes = (bytes: number, decimals = 0): string => {
* @param mimeType - The MIME type string to format.
* @returns The formatted MIME type string.
*/
export const formatMimeType = (mimeType: string): string | null => {
export const formatMimeType = (mimeType: string): string | undefined => {
const [, subtype] = mimeType.split("/")
let type: string
let type: string | undefined

switch (subtype) {
case "*":
return null
return undefined
default:
type = subtype
}

return type.toUpperCase()
return type?.toUpperCase()
}

0 comments on commit e950ed8

Please sign in to comment.