This commit is contained in:
Olivier Gagnon
2022-07-15 01:51:30 -04:00
parent 86c0913bd3
commit 4bee746576
33 changed files with 178 additions and 154 deletions
+1 -1
View File
@@ -3,7 +3,7 @@ import { format } from "date-fns";
export function formatTime(fmt: string): string {
try {
return format(new Date(), fmt);
} catch (err: any) {
} catch (e: unknown) {
return "format error";
}
}
+1 -2
View File
@@ -2,7 +2,6 @@
* Checks whether the value passed in can be considered a string.
* @param value The value to check if it is a string.
*/
// eslint-disable-next-line @typescript-eslint/explicit-module-boundary-types
export function isString(value: any): boolean {
export function isString(value: unknown): value is string {
return typeof value === "string" || value instanceof String;
}