MCPcopy Index your code
hub / github.com/OptimalBits/bull / parseScript

Method parseScript

lib/commands/script-loader.js:279–296  ·  view source on GitHub ↗

* Parse a (top-level) lua script * @param filename - the full path to the script * @param content - the content of the script * @param cache - cache

(filename, content, cache)

Source from the content-addressed store, hash-verified

277 * @param cache - cache
278 */
279 async parseScript(filename, content, cache) {
280 const { name, numberOfKeys } = splitFilename(filename);
281 const meta = cache ? cache.get(name) : undefined;
282 if (meta && meta.content === content) {
283 return meta;
284 }
285 const fileInfo = {
286 path: filename,
287 token: getPathHash(filename),
288 content,
289 name,
290 numberOfKeys,
291 includes: []
292 };
293
294 await this.resolveDependencies(fileInfo, cache);
295 return fileInfo;
296 }
297
298 /**
299 * Construct the final version of a file by interpolating its includes in dependency order.

Callers 1

loadCommandMethod · 0.95

Calls 3

resolveDependenciesMethod · 0.95
splitFilenameFunction · 0.85
getPathHashFunction · 0.85

Tested by

no test coverage detected