# 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`


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.getmesa.com/tools/custom-code/libraries/filter.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
