# core/predicates/check.predicate.ts

> 15 lines of code and 3 definitions.

Tree: GovLab Context
Language: typescript
Layer: infrastructure
Canonical: https://banes-lab.com/anatomy/context#file-context-core-predicates-check-predicate-ts
Source text: https://banes-lab.com/source/context/core/predicates/check.predicate.ts.txt

Listed in [core/predicates](https://banes-lab.com/api/source/context/core/predicates.md), after [core/predicates/algorithm.predicate.ts](https://banes-lab.com/source/context/core/predicates/algorithm.predicate.ts.md) and before [core/predicates/field.predicate.ts](https://banes-lab.com/source/context/core/predicates/field.predicate.ts.md).

## Definitions

- `answered` (lexical_declaration, line 7, exported)
- `isDeclaredAbsent` (lexical_declaration, line 15, exported)
- `answer` (lexical_declaration, line 8, exported)

## Contained in

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

## Uses

- [core/converters/check.converter.ts](https://banes-lab.com/source/context/core/converters/check.converter.ts.md)
- [core/predicates/field.predicate.ts](https://banes-lab.com/source/context/core/predicates/field.predicate.ts.md)

## Used by

- [core/analyzers/check.analyzer.ts](https://banes-lab.com/source/context/core/analyzers/check.analyzer.ts.md)

## Linked from

- [core/analyzers](https://banes-lab.com/anatomy/context/folder-context-core-analyzers.md)
- [core/converters](https://banes-lab.com/anatomy/context/folder-context-core-converters.md)
- [core/predicates](https://banes-lab.com/anatomy/context/folder-context-core-predicates.md)

## Source

```typescript
import type { CheckFacet, CheckQuestion } from "#types/check.types";
import { EVIDENCE_QUESTION } from "#configuration/constants/check.constants";
import { NONE_PREFIX } from "#configuration/constants/field.constants";
import { evidenceSignOf } from "#core/converters/check.converter";
import { lacksValue } from "#core/predicates/field.predicate";

export const answered = function answered(facet: CheckFacet | null, question: CheckQuestion): boolean {
    const answer = facet?.[question];
    if (typeof answer !== "string" || lacksValue(answer)) {
        return false;
    }
    return question !== EVIDENCE_QUESTION || evidenceSignOf(answer) !== null;
};

export const isDeclaredAbsent = function isDeclaredAbsent(facet: CheckFacet | null, question: CheckQuestion): boolean {
    return facet?.[question]?.startsWith(NONE_PREFIX) ?? false;
};
```
