# Filter

vendor/Filter.js

## Filter()

Procecsses filter conditions / values

**Returns**

* `Void`

## process(a, b, comparison, additional, options)

Processes filter comparison values, and comparison

**Parameters**

| Name                  | Type      | Description                                      |   |
| --------------------- | --------- | ------------------------------------------------ | - |
| a                     | `string`  |                                                  |   |
| b                     | `string`  |                                                  |   |
| comparison            | `string`  |                                                  |   |
| additional            | `array`   | Additional operator, a, b, and comparison fields |   |
| options               | `object`  |                                                  |   |
| options.setTaskStatus | `boolean` | If the task statis should be                     |   |
| options.strLabel      | `string`  | The text to set as the task's label              |   |

**Returns**

* `boolean`

## doProcessAdditional(additional)

Prevent empty context.trigger.metadata.additional values from being processed eg. metadata.additional: \[{operator: 'and', comparison: 'equals'}]

**Parameters**

| Name       | Type    | Description |   |
| ---------- | ------- | ----------- | - |
| additional | `Array` |             |   |

**Returns**

* `boolean`

## normalizeValue(value)

Convert comparison value from a string to something more comparable

**Parameters**

| Name  | Type     | Description |   |
| ----- | -------- | ----------- | - |
| value | `string` |             |   |

**Returns**

* `string` `boolean` `number`

## runCompare(a, b, comparison)

Runs compare with two values

**Parameters**

| Name       | Type                        | Description |   |
| ---------- | --------------------------- | ----------- | - |
| a          | `string` `boolean` `number` |             |   |
| b          | `string` `boolean` `number` |             |   |
| comparison | `string`                    |             |   |

**Returns**

* `boolean`

## stringify(a, b, comparison, additional)

Processes filter comparison values, and comparison

**Parameters**

| Name       | Type                        | Description                                      |   |
| ---------- | --------------------------- | ------------------------------------------------ | - |
| a          | `string` `boolean` `number` |                                                  |   |
| b          | `string` `boolean` `number` |                                                  |   |
| comparison | `string`                    |                                                  |   |
| additional | `array`                     | Additional operator, a, b, and comparison fields |   |

**Returns**

* `string`

## printableString(str)

Replace '' NaN with the string `(empty)`, handle other non-string types

**Parameters**

| Name | Type                        | Description |   |
| ---- | --------------------------- | ----------- | - |
| str  | `string` `boolean` `number` |             |   |

**Returns**

* `string`

## isEmpty(str)

Determine if a variable is empty. Definition of empty: undefined, null, empty string "", empty array \[], empty object {}

**Parameters**

| Name | Type                        | Description |   |
| ---- | --------------------------- | ----------- | - |
| str  | `string` `boolean` `number` |             |   |

**Returns**

* `boolean`
