decord/stable/source/utils/ContextUtils.tsx
github-actions 57c2214117 chore: update source for stable 347.12
Skipped 1 file(s) >100MB (GitHub limit): source/__polyfill/04xxx/module_4973.js (118.4 MB)
2026-09-29 21:26:22 +00:00

40 lines
1.1 KiB
TypeScript

// Module ID: 7702
// Function ID: 7703
// Name: ContextUtils
// Dependencies: [19, 21, 2]
// Exports: default
// Module 7702 (ContextUtils)
import noop from "module_19" /* 19 */;
const jsx = fn(21).jsx;
const size = fn(2);
const result = size.fileFinishedImporting("utils/ContextUtils.tsx");
export default function createDefinedContext() {
context = context.createContext(undefined);
const items = [
context,
function useContext() {
context = noop.useContext(context);
if (null == context) {
const _Error = Error;
const error = new Error("Context was used outside of defined provider.");
throw error;
} else {
return context;
}
},
() => {
context = context.useContext(context);
if (null == context) {
const _Error = Error;
const error = new Error("Context was used outside of defined provider.");
throw error;
} else {
return (children) => <context.Provider value={context}>{arg0.children}</context.Provider>;
}
}
];
return items;
};