Skip to content

Commit

Permalink
fix(deno): return void -> undefined type
Browse files Browse the repository at this point in the history
  • Loading branch information
lukeed committed Dec 20, 2023
1 parent 3218148 commit 743d85b
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion bin/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ console.log('\n~> "deno/readme.md" created');

fs.writeFileSync(denomod, content.replace(
'function lookup(extn) {',
'function lookup(extn: string): string | void {',
'function lookup(extn: string): string | undefined {',
).replace(
'const mimes = {',
'const mimes: Record<string, string> = {',
Expand Down
2 changes: 1 addition & 1 deletion deno/mod.ts
Original file line number Diff line number Diff line change
Expand Up @@ -407,7 +407,7 @@ export const mimes: Record<string, string> = {
"webm": "video/webm",
};

export function lookup(extn: string): string | void {
export function lookup(extn: string): string | undefined {
let tmp = ("" + extn).trim().toLowerCase();
let idx = tmp.lastIndexOf(".");
return mimes[!~idx ? tmp : tmp.substring(++idx)];
Expand Down

0 comments on commit 743d85b

Please # to comment.