# configuration/constants/walk.constants.ts

> 33 lines of code and 23 definitions.

Tree: GovLab Patterns
Language: typescript
Layer: infrastructure
Canonical: https://banes-lab.com/anatomy/patterns#file-patterns-configuration-constants-walk-constants-ts
Source text: https://banes-lab.com/source/patterns/configuration/constants/walk.constants.ts.txt

Listed in [configuration/constants](https://banes-lab.com/api/source/patterns/configuration/constants.md), after [configuration/constants/report.constants.ts](https://banes-lab.com/source/patterns/configuration/constants/report.constants.ts.md).

## Definitions

- `HALF` (lexical_declaration, line 3, exported)
- `HEX_CLASS` (lexical_declaration, line 5, exported)
- `HEX_STATE_PREFIX` (lexical_declaration, line 6, exported)
- `HEX_FLAG_PREFIX` (lexical_declaration, line 7, exported)
- `HEX_PATH_CLASS` (lexical_declaration, line 8, exported)
- `HEX_ARROW_CLASS` (lexical_declaration, line 9, exported)
- `HEX_WARN_CLASS` (lexical_declaration, line 10, exported)
- `HEX_WARN_PREFIX` (lexical_declaration, line 11, exported)
- `HEX_WARN_TEXT_CLASS` (lexical_declaration, line 12, exported)
- `HEX_EMPTY_CLASS` (lexical_declaration, line 13, exported)
- `HEX_REF_ATTRIBUTE` (lexical_declaration, line 14, exported)
- `REF_RADIX` (lexical_declaration, line 16, exported)
- `CELL_COLUMNS` (lexical_declaration, line 18, exported)
- `STATE_READ` (lexical_declaration, line 20, exported)
- `STATE_CALL` (lexical_declaration, line 21, exported)
- `STATE_WRITE` (lexical_declaration, line 22, exported)
- `STATE_DECLARE` (lexical_declaration, line 23, exported)
- `STATE_CONTROL` (lexical_declaration, line 24, exported)
- `STATE_STRUCT` (lexical_declaration, line 25, exported)
- `STATE_RULES` (lexical_declaration, line 27, exported)
- `MEANINGFUL_STATES` (lexical_declaration, line 38, exported)
- `HARDEN_TOKENS` (lexical_declaration, line 40, exported)
- `FORBIDDEN_MARKUP` (lexical_declaration, line 42, exported)

## Contained in

- [configuration/constants](https://banes-lab.com/anatomy/patterns/folder-patterns-configuration-constants.md)

## Source

```typescript
import type { StateRule } from "#types/walk.types";

export const HALF = 0.5;

export const HEX_CLASS = "hex";
export const HEX_STATE_PREFIX = "hex-";
export const HEX_FLAG_PREFIX = "hex-flagged-";
export const HEX_PATH_CLASS = "hex-path";
export const HEX_ARROW_CLASS = "hex-arrow";
export const HEX_WARN_CLASS = "hex-warn";
export const HEX_WARN_PREFIX = "hex-warn-";
export const HEX_WARN_TEXT_CLASS = "hex-warn-text";
export const HEX_EMPTY_CLASS = "hex-empty";
export const HEX_REF_ATTRIBUTE = "data-ref";

export const REF_RADIX = 36;

export const CELL_COLUMNS: readonly string[] = ["state", "depth", "label", "file", "line", "name", "text", "severity"];

export const STATE_READ = "read";
export const STATE_CALL = "call";
export const STATE_WRITE = "write";
export const STATE_DECLARE = "declare";
export const STATE_CONTROL = "control";
export const STATE_STRUCT = "structure";

export const STATE_RULES: readonly StateRule[] = [
    { state: STATE_CALL, tokens: ["call", "invocation", "new_expression"] },
    { state: STATE_WRITE, tokens: ["assignment", "augmented", "update_expression"] },
    { state: STATE_DECLARE, tokens: ["declaration", "definition", "declarator", "parameter"] },
    {
        state: STATE_CONTROL,
        tokens: ["if", "for", "while", "switch", "return", "try", "catch", "ternary", "conditional"],
    },
    { state: STATE_READ, tokens: ["identifier", "member", "property", "subscript", "attribute", "this"] },
];

export const MEANINGFUL_STATES: ReadonlySet<string> = new Set([STATE_DECLARE, STATE_CALL, STATE_WRITE, STATE_CONTROL]);

export const HARDEN_TOKENS: readonly string[] = ["href=", "xlink:", "url(", "onload=", "onclick=", "onerror="];

export const FORBIDDEN_MARKUP: readonly string[] = ["<script", "<iframe", "<foreignobject", ...HARDEN_TOKENS];
```
