This interface is used during the serialization of events into envelope (serialized object) which is sent to the services, the format is defined via the Common Schema 4.0 specification. The path and field names used are based on how the data is serialized to the service (CS 4.0 location) and not specifically the location on the event object you pass into the track methods (unless they are the same).

Hierarchy

  • ValueSanitizer

Implements

Constructors

Properties

addFieldSanitizer: ((fieldSanitizer) => void)

Type declaration

addSanitizer: ((sanitizer) => void)

Type declaration

    • (sanitizer): void
    • Add a value sanitizer as a fallback sanitizer if this sanitizer can't handle the path/name.

      Parameters

      Returns void

clearCache: (() => void)

Type declaration

    • (): void
    • Clear the current value sanitizer cache.

      Returns void

getFieldType: ((value) => FieldValueSanitizerType) = getFieldValueType

Type declaration

    • (value): FieldValueSanitizerType
    • Returns a bitwise value for the FieldValueSanitizerType enum representing the decoded type of the passed value

      Parameters

      • value: any

        The value to determine the type

      Returns FieldValueSanitizerType

handleField: ((path, name) => boolean)

Type declaration

    • (path, name): boolean
    • Does this field value sanitizer handle this path / field combination

      Parameters

      • path: string

        The field path

      • name: string

        The name of the field

      Returns boolean

isEmpty?: (() => boolean)

Type declaration

    • (): boolean
    • Returns whether this ValueSanitizer is empty

      Returns boolean

      true if it contains no chained sanitizers or field sanitizers, otherwise false

property: ((path, name, property, stringifyObjects?) => IEventProperty)

Type declaration

    • (path, name, property, stringifyObjects?): IEventProperty
    • Sanitizes the Property. It checks the that the property name and value are valid. It also checks/populates the correct type and pii of the property value.

      Parameters

      • path: string

        The root path of the property

      • name: string

        The property name.

      • property: IEventProperty

        The property value or an IEventProperty containing value, type ,pii and customer content.

      • Optional stringifyObjects: boolean

        If supplied tells the sanitizer that it should JSON stringify() objects

      Returns IEventProperty

      IEventProperty containing valid name, value, pii and type or null if invalid.

rmFieldSanitizer: ((theFieldSanitizer) => void)

Type declaration

    • (theFieldSanitizer): void
    • Removes the field sanitizer to the evaluation list if present

      Parameters

      Returns void

rmSanitizer: ((theSanitizer) => void)

Type declaration

    • (theSanitizer): void
    • Removes the value sanitizer as a fallback sanitizer if this sanitizer can't handle the path/name if present.

      Parameters

      Returns void

value: ((path, name, value, stringifyObjects?) => IEventProperty)

Type declaration

    • (path, name, value, stringifyObjects?): IEventProperty
    • Sanitizes the value. It checks the that the property name and value are valid. It also checks/populates the correct type and pii of the property value.

      Parameters

      • path: string

        The root path of the property

      • name: string

        The property name.

      • value: FieldValueSanitizerTypes

        The property value or an IEventProperty containing value, type ,pii and customer content.

      • Optional stringifyObjects: boolean

        If supplied tells the sanitizer that it should JSON stringify() objects

      Returns IEventProperty

      IEventProperty containing valid name, value, pii and type or null if invalid.

Generated using TypeDoc