mirror of
https://github.com/ajayyy/SponsorBlockServer.git
synced 2025-12-06 11:36:58 +03:00
17 lines
440 B
TypeScript
17 lines
440 B
TypeScript
import { Service } from "../types/segments.model";
|
|
|
|
export function getService<T extends string>(...value: T[]): Service {
|
|
for (const name of value) {
|
|
if (name) {
|
|
const service = Object.values(Service).find(
|
|
(val) => val.toLowerCase() === name.trim().toLowerCase()
|
|
);
|
|
if (service) {
|
|
return service;
|
|
}
|
|
}
|
|
}
|
|
|
|
return Service.YouTube;
|
|
}
|