decord/source/10104_usePropsErrorBoundary.js

44 lines
1.1 KiB
JavaScript
Raw Normal View History

2026-08-12 06:57:52 +00:00
// Module ID: 10104
// Function ID: 10105
2026-07-20 16:05:17 +00:00
// Name: usePropsErrorBoundary
2026-07-29 08:29:29 +00:00
// Dependencies: [19]
2026-07-20 16:05:17 +00:00
// Exports: usePropsErrorBoundary
2026-08-12 06:57:52 +00:00
// Module 10104 (usePropsErrorBoundary)
2026-07-29 08:29:29 +00:00
import noop from "noop";
2026-07-23 10:11:24 +00:00
2026-07-20 16:05:17 +00:00
export const usePropsErrorBoundary = function usePropsErrorBoundary(arg0) {
const React = arg0;
const items = [arg0];
2026-07-23 10:11:24 +00:00
const effect = React.useEffect(() => {
2026-07-20 16:05:17 +00:00
let dataLength;
let defaultIndex;
2026-07-29 08:29:29 +00:00
const size = noop;
({ defaultIndex, dataLength } = noop);
2026-08-04 21:03:28 +00:00
if (typeof defaultIndex === "number") {
2026-07-20 16:05:17 +00:00
if (dataLength > 0) {
const _Error3 = Error;
const error = new Error("DefaultIndex must be in the range of data length.");
throw error;
}
}
2026-07-29 08:29:29 +00:00
if (!size.mode) {
if (!size.vertical) {
if (!size.width) {
2026-07-20 16:05:17 +00:00
const _Error = Error;
const error1 = new Error("`width` must be specified for horizontal carousels.");
throw error1;
}
}
2026-07-29 08:29:29 +00:00
if (size.vertical) {
if (!size.height) {
2026-07-20 16:05:17 +00:00
const _Error2 = Error;
const error2 = new Error("`height` must be specified for vertical carousels.");
throw error2;
}
}
}
}, items);
};