decord/alpha/source/utils/ContextUtils.tsx
github-actions 97fd043558 chore: update source for alpha 347.5
Skipped 1 file(s) >100MB (GitHub limit): source/__polyfill/04xxx/module_4941.js (118.4 MB)
2026-09-19 06:52:51 +00:00

40 lines
1.1 KiB
TypeScript

// Module ID: 7668
// Function ID: 7669
// Name: ContextUtils
// Dependencies: [19, 21, 2]
// Exports: default
// Module 7668 (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;
};