MCPcopy Create free account
hub / github.com/TechJeeper/Printventory / getDb

Function getDb

main.js:9160–9167  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

9158 const allowedRoots = [
9159 path.resolve(getExtractTempDir()),
9160 path.resolve(path.join(getOsTempRoot(), EXTRACT_TEMP_DIR_NAME)),
9161 path.resolve(getOsTempRoot())
9162 ];
9163 try {
9164 if (typeof app !== 'undefined' && app && typeof app.isReady === 'function' && app.isReady()) {
9165 allowedRoots.push(path.resolve(path.join(app.getPath('userData'), EXTRACT_TEMP_DIR_NAME)));
9166 }
9167 } catch (_) { /* ignore */ }
9168
9169 const parent = path.resolve(path.dirname(resolved));
9170 return allowedRoots.some((root) => parent === root || resolved.startsWith(root + path.sep));

Callers 1

main.jsFile · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected