1

我有这样的功能

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

我应该怎么办?

4

0 回答 0