MCPcopy Create free account
hub / github.com/chhoumann/quickadd / optimistic

Method optimistic

src/gui/PackageManager/importDecisions.ts:249–257  ·  view source on GitHub ↗
(path: string)

Source from the content-addressed store, hash-verified

247 constructor(private readonly app: App) {}
248
249 optimistic(path: string): boolean {
250 const trimmed = path.trim();
251 if (!trimmed) return false;
252 // Untrusted package paths that escape the vault are never "present".
253 if (escapesVaultBoundary(trimmed)) return false;
254 return Boolean(
255 this.app.vault.getAbstractFileByPath(normalizePath(trimmed)),
256 );
257 }
258
259 private async resolve(path: string): Promise<boolean> {
260 const trimmed = path.trim();

Callers 1

Calls 3

escapesVaultBoundaryFunction · 0.90
normalizePathFunction · 0.90
getAbstractFileByPathMethod · 0.80

Tested by

no test coverage detected