# shared/manifests/verb.manifest.ts

> 25 lines of code and 5 definitions.

Tree: Governance tree
Language: typescript
Layer: infrastructure
Canonical: https://banes-lab.com/anatomy/governance#file-governance-shared-manifests-verb-manifest-ts
Source text: https://banes-lab.com/source/governance/shared/manifests/verb.manifest.ts.txt

Listed in [shared/manifests](https://banes-lab.com/api/source/governance/shared/manifests.md), after [shared/manifests/taxonomy.manifest.ts](https://banes-lab.com/source/governance/shared/manifests/taxonomy.manifest.ts.md) and before [shared/manifests/vocabulary.manifest.ts](https://banes-lab.com/source/governance/shared/manifests/vocabulary.manifest.ts.md).

## Definitions

- `opensWith` (lexical_declaration, line 18, exported)
- `isVerbOrOpensWith` (lexical_declaration, line 24, exported)
- `suffixAfterVerb` (lexical_declaration, line 28, exported)
- `LOOKUP_VERBS` (lexical_declaration, line 3, exported)
- `REGISTER_VERBS` (lexical_declaration, line 16, exported)

## Uses

- [codemods/analyzers/identifier.analyzer.ts](https://banes-lab.com/source/governance/codemods/analyzers/identifier.analyzer.ts.md)

## Used by

- [rules/eslint/closure-lifecycle-handle-must-be-stored.eslint.rule.ts](https://banes-lab.com/source/governance/rules/eslint/closure-lifecycle-handle-must-be-stored.eslint.rule.ts.md)

## Source

```typescript
import { isUpperAlpha } from "@govlab/constants";

export const LOOKUP_VERBS: readonly string[] = [
    "dispose",
    "emit",
    "find",
    "get",
    "has",
    "load",
    "preload",
    "resolve",
    "subscribe",
    "unsubscribe",
];

export const REGISTER_VERBS: readonly string[] = ["register", "unregister"];

export const opensWith = function opensWith(name: string, verbs: readonly string[]): boolean {
    return verbs.some(
        (verb) => name.startsWith(verb) && name.length > verb.length && isUpperAlpha(name.charAt(verb.length)),
    );
};

export const isVerbOrOpensWith = function isVerbOrOpensWith(name: string, verbs: readonly string[]): boolean {
    return verbs.includes(name) || opensWith(name, verbs);
};

export const suffixAfterVerb = function suffixAfterVerb(name: string, verb: string): string | null {
    return opensWith(name, [verb]) ? name.slice(verb.length) : null;
};
```
