Skip to content

Commit

Permalink
refactor: remove unnecessary signature
Browse files Browse the repository at this point in the history
  • Loading branch information
TomokiMiyauci committed Apr 8, 2023
1 parent b1a6070 commit 847d814
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion head.ts
Original file line number Diff line number Diff line change
Expand Up @@ -60,5 +60,5 @@ export function head<T>(input: Iterable<T>): T | undefined;
export function head<T>(input: Iterable<T>): T | undefined {
const element = [...input][0];

return isString(input) ? element ?? "" as unknown as T : element;
return isString(input) ? element ?? "" as T : element;
}
2 changes: 1 addition & 1 deletion last.ts
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ export function last<T>(input: Iterable<T>): T | undefined;
export function last<T>(input: Iterable<T>): T | undefined {
const result = [...input].pop();

return isString(input) ? result ?? "" as unknown as T : result;
return isString(input) ? result ?? "" as T : result;
}

/** Infer the last element of string. */
Expand Down

0 comments on commit 847d814

Please sign in to comment.