Merge pull request #1550 from mchangrh/stricter-ts

add noFallThrough, inplicitReturn, update packages
This commit is contained in:
Ajay Ramachandran
2022-11-04 17:06:36 -04:00
committed by GitHub
12 changed files with 1300 additions and 1734 deletions

View File

@@ -2112,11 +2112,11 @@ async function vote(type: number, UUID: SegmentUUID, category?: Category, skipNo
return response;
}
async function voteAsync(type: number, UUID: SegmentUUID, category?: Category): Promise<VoteResponse> {
async function voteAsync(type: number, UUID: SegmentUUID, category?: Category): Promise<VoteResponse | undefined> {
const sponsorIndex = utils.getSponsorIndexFromUUID(sponsorTimes, UUID);
// Don't vote for preview sponsors
if (sponsorIndex == -1 || sponsorTimes[sponsorIndex].source !== SponsorSourceType.Server) return;
if (sponsorIndex == -1 || sponsorTimes[sponsorIndex].source !== SponsorSourceType.Server) return Promise.resolve(undefined);
// See if the local time saved count and skip count should be saved
if (type === 0 && sponsorSkipped[sponsorIndex] || type === 1 && !sponsorSkipped[sponsorIndex]) {