# core/plugins/syntax.field.plugin.ts

> 20 lines of code and 3 definitions.

Tree: GovLab Docs
Language: typescript
Layer: infrastructure
Canonical: https://banes-lab.com/anatomy/docs#file-docs-core-plugins-syntax-field-plugin-ts
Source text: https://banes-lab.com/source/docs/core/plugins/syntax.field.plugin.ts.txt

Listed in [core/plugins](https://banes-lab.com/api/source/docs/core/plugins.md), after [core/plugins/syntax.failure.plugin.ts](https://banes-lab.com/source/docs/core/plugins/syntax.failure.plugin.ts.md) and before [core/plugins/syntax.registrar.plugin.ts](https://banes-lab.com/source/docs/core/plugins/syntax.registrar.plugin.ts.md).

## Definitions

- `recognizer` (lexical_declaration, line 5, exported)
- `classify` (method_definition, line 6, exported)
- `id` (lexical_declaration, line 13, exported)

## Contained in

- [core/plugins](https://banes-lab.com/anatomy/docs/folder-docs-core-plugins.md)

## Source

```typescript
import { GRAPH_LABELS } from "#configuration/strings/graph.strings";
import type { Recognizer } from "#types/code.types";
import ts from "typescript";

export const recognizer: Recognizer = {
    classify(node, context) {
        if (!ts.isBinaryExpression(node) || node.operatorToken.kind !== ts.SyntaxKind.EqualsToken) {
            return null;
        }
        if (!ts.isPropertyAccessExpression(node.left)) {
            return null;
        }
        const id = context.mkNodeId(node);
        return {
            edges: [{ from: context.currentId, kind: "data-flow", label: GRAPH_LABELS.writes, to: id }],
            nodes: [{ id, kind: "store", label: node.left.name.text, source: context.sourceOf(node) }],
        };
    },
    emits: { edges: ["data-flow"], nodes: ["store"] },
    name: "store",
};
```
