Function: isCmcdCustomKey()
ts
function isCmcdCustomKey(key): boolean;Defined in: isCmcdCustomKey.ts:22
Check if a key is a valid custom key: a lowercase first letter, then characters from a-z 0-9 . -. The key needs a hyphen, not at the start or end. This check applies the CTA-5004-B custom-key rules, restricted to names that RFC 8941 key serialization accepts.
Parameters
key
The key to check.
Returns
boolean
true if the key is a custom key, false otherwise.
Example
ts
equal(isCmcdCustomKey('com.example-key'), true)
equal(isCmcdCustomKey('br'), false)