1
0
Fork 0
peertube/server/helpers/custom-validators/video-stats.ts

17 lines
387 B
TypeScript
Raw Normal View History

import { VideoStatsTimeserieMetric } from '@shared/models'
const validMetrics = new Set<VideoStatsTimeserieMetric>([
'viewers',
'aggregateWatchTime'
])
function isValidStatTimeserieMetric (value: VideoStatsTimeserieMetric) {
return validMetrics.has(value)
}
// ---------------------------------------------------------------------------
export {
isValidStatTimeserieMetric
}