decord/source/utils/ContextUtils.tsx
github-actions cd74c1f217 chore: update source for alpha 345.5
Skipped 1 file(s) >100MB (GitHub limit): source/__vendor/09xxx/9667_m.js (378 MB)
2026-09-05 10:56:28 +00:00

39 lines
1.1 KiB
TypeScript

// Module ID: 7428
// Function ID: 7429
// Name: createDefinedContext
// Dependencies: [19, 21, 2]
// Exports: default
// Module 7428 (createDefinedContext)
import closure_0 from "noop" /* 19 */;
import { jsx } from "jsxProd" /* 21 */;
const result = require("set").fileFinishedImporting("utils/ContextUtils.tsx");
export default function createDefinedContext() {
context = context.createContext(undefined);
const items = [
context,
function useContext(context) {
context = context.useContext(context);
if (null == context) {
const _Error = Error;
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;
error = new Error("Context was used outside of defined provider.");
throw error;
} else {
return (children) => closure_2_1(context.Provider, { value: context, children: children.children });
}
}
];
return items;
};