decord/alpha/source/modules/activities/utils/isStreaming.tsx

42 lines
1.1 KiB
TypeScript
Raw Normal View History

2026-10-09 10:00:15 +00:00
// Module ID: 8368
// Function ID: 8369
// Name: isStreaming
2026-10-09 10:00:15 +00:00
// Dependencies: [2024, 1085, 2]
2026-07-20 16:05:17 +00:00
// Exports: default
2026-10-09 10:00:15 +00:00
// Module 8368 (isStreaming)
2026-10-03 08:58:59 +00:00
import Constants from "Constants" /* 1085 */;
2026-10-09 10:00:15 +00:00
import Constants2 from "Constants" /* 2024 */;
import size from "module_2" /* 2 */;
2026-07-20 16:05:17 +00:00
function _isStreaming(type) {
let tmp = type.type === ActivityTypes.STREAMING;
if (tmp) {
2026-10-03 08:58:59 +00:00
const isMatch = null != type.url && validStreamURL.test(type.url);
2026-07-20 16:05:17 +00:00
tmp = isMatch;
}
return tmp;
}
const validStreamURL = Constants2.validStreamURL;
const ActivityTypes = Constants.ActivityTypes;
const result = size.fileFinishedImporting("modules/activities/utils/isStreaming.tsx");
2026-07-20 16:05:17 +00:00
2026-10-03 08:58:59 +00:00
export default function isStreaming(react) {
let tmp = null != react;
if (tmp) {
let someResult;
2026-07-20 16:05:17 +00:00
const _Array = Array;
2026-10-03 08:58:59 +00:00
if (Array.isArray(react)) {
someResult = react.some(_isStreaming);
2026-07-20 16:05:17 +00:00
} else {
2026-10-03 08:58:59 +00:00
someResult = react.type === ActivityTypes.STREAMING;
2026-07-29 08:29:29 +00:00
if (someResult) {
2026-10-03 08:58:59 +00:00
const isMatch = null != react.url && validStreamURL.test(react.url);
2026-07-29 08:29:29 +00:00
someResult = isMatch;
}
2026-07-20 16:05:17 +00:00
}
2026-10-03 08:58:59 +00:00
tmp = someResult;
2026-07-20 16:05:17 +00:00
}
2026-10-03 08:58:59 +00:00
return tmp;
2026-07-20 16:05:17 +00:00
};