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

Function buildFileScopeSignature

src/utils/fileSyntax.ts:72–87  ·  view source on GitHub ↗

* The slash- and order-insensitive part of the cache key that determines WHICH * files the picker lists (folder + tag/exclude-* filters). Two tokens that share * this list can meaningfully share a pick; two that don't, can't.

(folderPath: string, filter: FieldFilter)

Source from the content-addressed store, hash-verified

70 * this list can meaningfully share a pick; two that don't, can't.
71 */
72function buildFileScopeSignature(folderPath: string, filter: FieldFilter): string {
73 const parts = [`folder=${normalizeFolder(folderPath)}`];
74 if (filter.folders?.length)
75 parts.push(`folders=${encodeSignatureList(filter.folders, normalizeFolder)}`);
76 if (filter.tags?.length)
77 parts.push(`tags=${encodeSignatureList(filter.tags)}`);
78 if (filter.excludeFolders?.length)
79 parts.push(
80 `xfolder=${encodeSignatureList(filter.excludeFolders, normalizeFolder)}`,
81 );
82 if (filter.excludeTags?.length)
83 parts.push(`xtag=${encodeSignatureList(filter.excludeTags)}`);
84 if (filter.excludeFiles?.length)
85 parts.push(`xfile=${encodeSignatureList(filter.excludeFiles)}`);
86 return parts.join("|");
87}
88
89/**
90 * Full identity signature for an un-named token. Builds on the scope signature

Callers 2

buildFileSignatureFunction · 0.85
parseFileTokenFunction · 0.85

Calls 3

normalizeFolderFunction · 0.85
encodeSignatureListFunction · 0.85
pushMethod · 0.80

Tested by

no test coverage detected