Skip to main content

argumentsSimpleKey

@webda/cache


Function: argumentsSimpleKey()

argumentsSimpleKey(args): string | undefined

Defined in: packages/cache/src/cache.ts:464

Compute a simple typed key for a list of arguments without hashing.

Uses length-prefixed, type-tagged encoding to produce a unique string representation for each distinct argument list, or undefined if any argument cannot be serialized deterministically.

Format per argument: <TYPE><LENGTH>:<VALUE> where TYPE is a single uppercase letter identifying the argument type. No separator is needed between arguments because the length prefix makes the encoding unambiguous.

This is faster than argumentsHash because it skips the SHA-256 step. Keys may be longer in proportion to argument size. Prefer this strategy for hot sync paths with small, simple arguments.

Parameters​

args​

any[]

the arguments to encode

Returns​

string | undefined

typed key string or undefined