MCPcopy Index your code
hub / github.com/codebymitch/TitanBot / validateBitrate

Function validateBitrate

src/services/joinToCreateService.js:71–91  ·  view source on GitHub ↗
(bitrate)

Source from the content-addressed store, hash-verified

69}
70
71export function validateBitrate(bitrate) {
72 const bitrateNum = parseInt(bitrate);
73
74 if (isNaN(bitrateNum)) {
75 throw new TitanBotError(
76 'Bitrate must be a valid number',
77 ErrorTypes.VALIDATION,
78 'Please enter a valid number for bitrate.'
79 );
80 }
81
82 if (bitrateNum < 8 || bitrateNum > 384) {
83 throw new TitanBotError(
84 'Bitrate out of valid range',
85 ErrorTypes.VALIDATION,
86 'Bitrate must be between 8 and 384 kbps.'
87 );
88 }
89
90 return true;
91}
92
93export function validateUserLimit(limit) {
94 const limitNum = parseInt(limit);

Callers 3

initializeJoinToCreateFunction · 0.85
updateChannelConfigFunction · 0.85
createTemporaryChannelFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected