MCPcopy Create free account
hub / github.com/Moddable-OpenSource/moddable / appendImageDirectory

Method appendImageDirectory

tools/mcmanifest.js:2276–2292  ·  view source on GitHub ↗
(name, path, include, suffix)

Source from the content-addressed store, hash-verified

2274 file.quality = (a && (a.length == 3) && (a[2] !== undefined)) ? parseInt(a[2]) : undefined;
2275 }
2276 appendImageDirectory(name, path, include, suffix) {
2277 var tool = this.tool;
2278 var files = tool.imageFiles;
2279 var source = tool.resolveDirectoryPath(path);
2280 var target = name + ".cs";
2281 if (files.already[source])
2282 return;
2283 files.already[source] = true;
2284 if (!include)
2285 return;
2286 if (files.find(file => file.target == target))
2287 return;
2288 let a = suffix.match(/-image(\(([0-9]+)\))?/);
2289 let quality = (a && (a.length == 3) && (a[2] !== undefined)) ? parseInt(a[2]) : undefined;
2290 files.push({ target, source, quality });
2291 this.count++;
2292 }
2293 appendOutlineFont(name, path, include, suffix, query) {
2294 const tool = this.tool;
2295 let file = this.appendFile(tool.outlineFontFiles, name + ".fnt", path, include);

Callers 1

appendSourceMethod · 0.95

Calls 2

findMethod · 0.80
pushMethod · 0.45

Tested by

no test coverage detected