MCPcopy
hub / github.com/patriksimek/vm2 / registerModule

Method registerModule

lib/resolver-compat.js:134–143  ·  view source on GitHub ↗
(mod, filename, path, parent, direct)

Source from the content-addressed store, hash-verified

132 }
133
134 registerModule(mod, filename, path, parent, direct) {
135 const trustedParent = this.trustedMods.get(parent);
136 this.trustedMods.set(mod, {
137 filename,
138 path,
139 paths: this.genLookupPaths(path),
140 allowTransitive: this.allowTransitive &&
141 ((direct && trustedParent && trustedParent.allowTransitive) || this.externals.some(regex => regex.test(filename)))
142 });
143 }
144
145 resolveFull(mod, x, options, extList, direct) {
146 this.currMod = undefined;

Callers

nothing calls this directly

Calls 3

genLookupPathsMethod · 0.80
getMethod · 0.45
setMethod · 0.45

Tested by

no test coverage detected