# core/predicates/link.predicate.ts

> 11 lines of code and 2 definitions.

Tree: Site tree
Language: typescript
Layer: infrastructure
Canonical: https://banes-lab.com/anatomy/tree#file-core-predicates-link-predicate-ts
Source text: https://banes-lab.com/assets/sources/source.f88726f47f78b66a1854bc1d66efa7190b563c9ae051c040380da885496f0374.generated.txt

## Definitions

- `isGenericLabel` (lexical_declaration, line 11, exported)
- `collapseText` (lexical_declaration, line 4)

## Used by

- [presentation/components/link.component.ts](https://banes-lab.com/source/tree/presentation/components/link.component.ts.md)

## Source

```typescript
import { GENERIC_LINK_TEXT } from "#configuration/constants/link.constants";
import { SPACE } from "#configuration/constants/document.constants";

const collapseText = function collapseText(text: string): string {
    return text
        .split(SPACE)
        .filter((word) => word.length > 0)
        .join(SPACE);
};

export const isGenericLabel = function isGenericLabel(text: string): boolean {
    return GENERIC_LINK_TEXT.has(collapseText(text).toLowerCase());
};
```
