Chocobozzz/PeerTube

View on GitHub
server/core/helpers/custom-validators/video-stats.ts

Summary

Maintainability
A
0 mins
Test Coverage
import { VideoStatsTimeserieMetric } from '@peertube/peertube-models'

const validMetrics = new Set<VideoStatsTimeserieMetric>([
  'viewers',
  'aggregateWatchTime'
])

function isValidStatTimeserieMetric (value: VideoStatsTimeserieMetric) {
  return validMetrics.has(value)
}

// ---------------------------------------------------------------------------

export {
  isValidStatTimeserieMetric
}