51Degrees IP Intelligence for Node.js

DataExtension Class Reference

Detailed Description

Static Public Member Functions

static formatValue (item)
 Format a single value for human-readable output.
static getValueHelper (elementData, propertyName)
 Helper to get a human readable value of an aspect property value.

Member Function Documentation

◆ formatValue()

DataExtension::formatValue ( item)
inlinestatic

Format a single value for human-readable output.

Weighted values (objects with 'value' and 'weight' entries) are formatted as 'value' when the weight is 1, or 'value (xx.xx%)' otherwise.

Parameters
{*}item value to format
Returns
{string} human readable form of the value

◆ getValueHelper()

DataExtension::getValueHelper ( elementData,
propertyName )
inlinestatic

Helper to get a human readable value of an aspect property value.

IP intelligence values are commonly lists of weighted values, which are formatted as a comma separated list with weights where the weight is not 1.

Parameters
{object}elementData the element data from a flow data
{string}propertyName name of the property to get
Returns
{string} human readable value of the property
Examples
cloud/getallproperties-console/getAllProperties.js, cloud/gettingstarted-console/gettingStarted.js, cloud/mixed/gettingstarted-console/gettingStarted.js, and onpremise/offlineprocessing-console/offlineProcessing.js.