分析错误,类型检查器函数上缺少分号
本文介绍了分析错误,类型检查器函数上缺少分号的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我已创建正确的类型检查器函数,但解析器告诉我缺少分号,但我不知道在哪里。
我的代码
export const IsFirestoreUserData = (toVerify: any): toVerify is FirestoreUserData => {
if (toVerify.profile === undefined) return false;
if (toVerify.profile.name === undefined) return false;
if (toVerify.profile.surname === undefined) return false;
if (toVerify.conversations === undefined) return false;
if (typeof toVerify.conversations !== "object") return false;
return true;
};
错误
Line 37:2: Parsing error: Missing semicolon
35 | export const IsFirestoreUserData = (
36 | toVerify: any
> 37 | ): toVerify is FirestoreUserData => {
| ^
38 | if (toVerify.profile === undefined) return false;
39 | if (toVerify.profile.name === undefined) return false;
40 | if (toVerify.profile.surname === undefined) return false;
感谢您的帮助