Options
All
  • Public
  • Public/Protected
  • All
Menu

cmcd.js

Index

Type aliases

CmcdCustomKey

CmcdCustomKey: `${string}-${string}`

CmcdKey

CmcdKey: keyof Cmcd

CmcdValue

CmcdValue: CmcdObjectType | CmcdStreamingFormat | CmcdStreamType | string | number | boolean | Symbol | undefined

Functions

appendToHeaders

  • appendToHeaders(headers: Record<string, string>, cmcd: Cmcd, customHeaderMap?: Record<`${string}-${string}`, CmcdHeader>): Record<string, string>
  • Append CMCD query args to a header object.

    Parameters

    • headers: Record<string, string>
    • cmcd: Cmcd
    • Optional customHeaderMap: Record<`${string}-${string}`, CmcdHeader>

    Returns Record<string, string>

appendToUrl

  • appendToUrl(url: string, cmcd: Cmcd): string
  • Append CMCD query args to a URL.

    Parameters

    • url: string
    • cmcd: Cmcd

    Returns string

serialize

  • serialize(obj: Cmcd): string
  • Serialize a CMCD object.

    Parameters

    Returns string

toHeaders

  • toHeaders(cmcd: Cmcd, customHeaderMap?: Record<`${string}-${string}`, CmcdHeader>): Record<string, string>
  • Convert a CMCD data object to request headers

    Parameters

    • cmcd: Cmcd
    • customHeaderMap: Record<`${string}-${string}`, CmcdHeader> = {}

    Returns Record<string, string>

toJson

  • toJson(cmcd: Partial<Cmcd>): string
  • Convert a CMCD data object to JSON

    Parameters

    Returns string

toQuery

  • toQuery(cmcd: Cmcd): string
  • Convert a CMCD data object to query args

    Parameters

    Returns string

uuid

  • uuid(): string
  • Generate a random v4 UUID

    Returns string