decord/source/10210_usePropsErrorBoundary.js

42 lines
1.1 KiB
JavaScript
Raw Normal View History

2026-08-25 06:04:03 +00:00
// Module ID: 10210
// Function ID: 10211
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-25 06:04:03 +00:00
// Module 10210 (usePropsErrorBoundary)
2026-08-24 06:08:38 +00:00
import closure_0 from "noop" /* 19 */;
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-08-24 06:08:38 +00:00
const size = closure_0;
({ defaultIndex, dataLength } = closure_0);
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;
2026-08-24 06:08:38 +00:00
error = new Error("DefaultIndex must be in the range of data length.");
2026-07-20 16:05:17 +00:00
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);
};