/** * Validates the `maxVideos` prop shared by the feed components. * * The native SDK treats the cap as "total number of videos ever loaded", so only a * positive integer is meaningful; anything else is ignored (no cap) and the caller * is expected to warn. * * @returns the value when it is a positive integer, otherwise `undefined`. */ export function normalizeMaxVideos( maxVideos: number | null | undefined ): number | undefined { if (maxVideos === undefined || maxVideos === null) { return undefined; } if ( typeof maxVideos !== 'number' || !Number.isInteger(maxVideos) || maxVideos <= 0 ) { return undefined; } return maxVideos; }