chore: import upstream snapshot with attribution

This commit is contained in:
wehub-resource-sync
2026-07-13 13:32:57 +08:00
commit cd420f9332
4811 changed files with 884702 additions and 0 deletions
+22
View File
@@ -0,0 +1,22 @@
const MINIMUM_MAX_DURATION = 5;
const MAXIMUM_MAX_DURATION = 2_147_483_647; // largest 32-bit signed integer
export function clampMaxDuration(maxDuration: number): number {
return Math.min(Math.max(maxDuration, MINIMUM_MAX_DURATION), MAXIMUM_MAX_DURATION);
}
export function getMaxDuration(
maxDuration?: number | null,
defaultMaxDuration?: number | null
): number | undefined {
if (!maxDuration) {
return defaultMaxDuration ?? undefined;
}
// Setting the maxDuration to MAXIMUM_MAX_DURATION means we don't want to use the default maxDuration
if (maxDuration === MAXIMUM_MAX_DURATION) {
return;
}
return maxDuration;
}