MCPcopy Create free account
hub / github.com/Kong/insomnia / addModule

Function addModule

packages/insomnia/src/main/templating-worker-database.ts:253–260  ·  view source on GitHub ↗
(key: string, source: string)

Source from the content-addressed store, hash-verified

251 // Count UTF-8 bytes (not source.length, which is UTF-16 code units and undercounts multi-byte
252 // characters) so the limit reflects the real payload shipped into the sandbox envelope.
253 const addModule = (key: string, source: string): void => {
254 totalBytes += Buffer.byteLength(source, 'utf8');
255 if (totalBytes > MAX_PLUGIN_MODULE_BYTES) {
256 throw new Error('plugin source exceeds the sandbox size limit');
257 }
258 moduleFiles[key] = source;
259 fileCount++;
260 };
261 const walk = (dir: string): void => {
262 for (const entry of fs.readdirSync(dir, { withFileTypes: true })) {
263 if (entry.name === 'node_modules' || entry.name.startsWith('.')) {

Callers 2

walkFunction · 0.85
readPluginModuleMapFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected