* 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)
| 70 | * this list can meaningfully share a pick; two that don't, can't. |
| 71 | */ |
| 72 | function 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 |
no test coverage detected