MCPcopy Index your code
hub / github.com/Paciolan/remote-component / createLoadRemoteModule

Function createLoadRemoteModule

src/lib/loadRemoteModule.ts:32–48  ·  view source on GitHub ↗
({
  requires,
  fetcher
} = {})

Source from the content-addressed store, hash-verified

30}
31
32export const createLoadRemoteModule: CreateLoadRemoteModule = ({
33 requires,
34 fetcher
35} = {}) => {
36 const _requires = requires || defaultRequires;
37 const _fetcher = fetcher || defaultFetcher;
38
39 return memoize(url =>
40 _fetcher(url).then(data => {
41 const exports = {};
42 const module = { exports };
43 const func = new Function("require", "module", "exports", data);
44 func(_requires, module, exports);
45 return module.exports;
46 })
47 );
48};

Callers 1

Calls 1

memoizeFunction · 0.85

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…