Function: fromCmcdUrl()
Call Signature
ts
function fromCmcdUrl(url, options): Cmcd;Defined in: fromCmcdUrl.ts:24
Decode CMCD data from a URL encoded string.
A + decodes as a space, as in application/x-www-form-urlencoded. A %2B decodes as a +.
Parameters
url
string
The URL encoded string to decode.
options
CmcdDecodeOptions & object
Options for decoding.
Returns
The decoded CMCD data.
See
CTA-5004-B Query Argument Definition
Example
ts
const query =
'br%3D1000%2Ccom.example-hello%3D%22world%22%2Cec%3D(%22ERR001%22%20%22ERR002%22)%2Csu'
deepEqual(fromCmcdUrl(query), {
br: 1000,
'com.example-hello': 'world',
ec: ['ERR001', 'ERR002'],
su: true,
})Call Signature
ts
function fromCmcdUrl(url, options?): CmcdData;Defined in: fromCmcdUrl.ts:38
Decode CMCD data from a URL encoded string.
Parameters
url
string
The URL encoded string to decode.
options?
Options for decoding.
Returns
The decoded CMCD data.