我有这样的功能
export const createMemberId: (x: any) => Maybe<MemberId> = (x: any) => {
try {
return Just({
memberId: mongoose.Types.ObjectId(x),
});
} catch (e) {
return Nothing;
}
};
它得到any
并返回Maybe<MemberId>
但是打字稿告诉我这个错误
`Maybe` refers to a value, but being used as type here
我该怎么办?