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

Function encodeSignatureList

src/utils/fileSyntax.ts:60–65  ·  view source on GitHub ↗

* Serialize a filter list into a delimiter-safe, order-insensitive token. A * filter value can itself contain a comma (Obsidian folder/tag/file names may, * and the token grammar only ever splits on `|`), so a plain `,`-join is NOT * injective: `['a,b']` and `['a', 'b']` would both render as `a,b

(
	values: readonly string[],
	transform: (value: string) => string = (value) => value,
)

Source from the content-addressed store, hash-verified

58 * the encoding unambiguous (`["a,b"]` vs `["a","b"]`).
59 */
60function encodeSignatureList(
61 values: readonly string[],
62 transform: (value: string) => string = (value) => value,
63): string {
64 return JSON.stringify([...values].map(transform).sort());
65}
66
67/**
68 * The slash- and order-insensitive part of the cache key that determines WHICH

Callers 1

buildFileScopeSignatureFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected