Function: isCmsdCustomKey()
ts
function isCmsdCustomKey(key): boolean;Defined in: cmsd/src/isCmsdCustomKey.ts:20
Check if a key is a valid custom key: a lowercase first letter, then characters from a-z 0-9 . -, with a hyphen that is neither the first nor the last character. These are the CMSD custom-key rules restricted to names that survive RFC 8941 key serialization.
Parameters
key
string
The key to check.
Returns
boolean
true if the key is a custom key, false otherwise.
Example
ts
equal(isCmsdCustomKey('com.example-key'), true)
equal(isCmsdCustomKey('br'), false)