我已经创建了一个正确的类型检查器函数,但解析器告诉我缺少一个分号,但我不知道在哪里。
我的代码
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;
};
Run Code Online (Sandbox Code Playgroud)
错误
Line 37:2: Parsing error: Missing semicolon
35 | export const IsFirestoreUserData = (
36 | toVerify: any
> 37 | ): toVerify is FirestoreUserData => {
| ^
38 | if (toVerify.profile …Run Code Online (Sandbox Code Playgroud)