Tag Status Functions
$statusesToBits()
Signature: $statusesToBits(Array<string> | string)
Converts a status string or an array of status strings to their corresponding bit values.
If a string contains multiple statuses separated by commas, their bits are combined.
Returns a single bit value for a string, or an array of bit values for an array of statuses as strings.
Parameters
| Parameter | Type | Description |
|---|---|---|
Array<string> | string |
Array of strings or string | Status(es) to convert (Required) |
Examples
$statusesToBits('ROC,LLA') => 3
$statusesToBits(['ROC', 'LLA']) => [1, 2]
$statusesToBits(['ROC,LLA', 'HIA']) => [3, 8]
$statusToValue()
Signature: $statusToValue(Array<number> | number)
Converts status bit values (or arrays of bit values) to their corresponding status string representations.
If an array is provided, each bit value is converted and the results are joined with commas.
Parameters
| Parameter | Type | Description |
|---|---|---|
Array<number> | number |
Array of numbers or number | Bit value(s) to convert (Required) |
Examples
$statusToValue(1) => "ROC"
$statusToValue([1, 2, 4]) => "ROC,LLA,LOA"