migrate to typescript

This commit is contained in:
Dainius Daukševičius
2020-10-17 21:56:54 +03:00
committed by Dainius Dauksevicius
parent c462323dd5
commit 08d27265fc
120 changed files with 5002 additions and 4711 deletions

View File

@@ -0,0 +1,24 @@
import {handleGetSegments} from './getSkipSegments';
import {Request, Response} from 'express';
export function oldGetVideoSponsorTimes(req: Request, res: Response) {
let segments = handleGetSegments(req, res);
if (segments) {
// Convert to old outputs
let sponsorTimes = [];
let UUIDs = [];
for (const segment of segments) {
sponsorTimes.push(segment.segment);
UUIDs.push(segment.UUID);
}
res.send({
sponsorTimes,
UUIDs,
});
}
// Error has already been handled in the other method
}