midjourney-api
midjourney-api copied to clipboard
Logical Error in `VerifyHuman` Constructor
Describe the bug
Hello,
I've found a potential issue in the VerifyHuman class, specifically in its constructor. Currently, the constructor throws an error if the HuggingFaceToken is an empty string or if it exists. Here's the relevant code:
if (HuggingFaceToken === "" || HuggingFaceToken) {
throw new Error("HuggingFaceToken is required");
}
However, I believe the intended behavior is to throw an error if HuggingFaceToken is an empty string or if it does not exist. The corrected code would look like this:
if (HuggingFaceToken === "" || !HuggingFaceToken) {
throw new Error("HuggingFaceToken is required");
}
This change will ensure that an error is thrown when HuggingFaceToken is either an empty string or undefined, which seems to be the intended behavior.
Please let me know if you need any further information or clarification.
Best regards.