decord/source/9723_usePropsErrorBoundary.js

44 lines
1.1 KiB
JavaScript
Raw Normal View History

2026-07-29 08:29:29 +00:00
// Module ID: 9723
// Function ID: 9724
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-07-29 08:29:29 +00:00
// Module 9723 (usePropsErrorBoundary)
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);
if (typeof defaultIndex !== "os") {
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);
};