# configuration/strings/field.strings.ts

> 37 lines of code and 7 definitions.

Tree: GovLab Context
Language: typescript
Layer: product
Canonical: https://banes-lab.com/anatomy/context#file-context-configuration-strings-field-strings-ts
Source text: https://banes-lab.com/source/context/configuration/strings/field.strings.ts.txt

Listed in [configuration/strings](https://banes-lab.com/api/source/context/configuration/strings.md), after [configuration/strings/architecture.strings.ts](https://banes-lab.com/source/context/configuration/strings/architecture.strings.ts.md) and before [configuration/strings/grammar.strings.ts](https://banes-lab.com/source/context/configuration/strings/grammar.strings.ts.md).

## Definitions

- `missingField` (lexical_declaration, line 17, exported)
- `misshapenField` (lexical_declaration, line 21, exported)
- `nonKebabId` (lexical_declaration, line 25, exported)
- `refusedRecord` (lexical_declaration, line 29, exported)
- `outsideVocabulary` (lexical_declaration, line 38, exported)
- `SHAPE_NAMES` (lexical_declaration, line 3, exported)
- `NO_ID` (lexical_declaration, line 15, exported)

## Contained in

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

## Used by

- [core/normalizers/field.normalizer.ts](https://banes-lab.com/source/context/core/normalizers/field.normalizer.ts.md)
- [core/validators/field.validator.ts](https://banes-lab.com/source/context/core/validators/field.validator.ts.md)

## Linked from

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

## Source

```typescript
import type { FieldType } from "#types/field.types";

export const SHAPE_NAMES: Readonly<Record<FieldType, string>> = {
    closed: "a string",
    flag: "true or false",
    label: "a string",
    labels: "a list of strings",
    object: "an object",
    records: "a list of objects",
    ref: "a record id",
    refs: "a list of record ids",
    text: "a string",
};

export const NO_ID = "(no id)";

export const missingField = function missingField(path: string): string {
    return `has no ${path}, which its kind requires`;
};

export const misshapenField = function misshapenField(path: string, shape: string): string {
    return `has ${path} set to something other than ${shape}`;
};

export const nonKebabId = function nonKebabId(id: string): string {
    return `has the id "${id}", which is not kebab-case`;
};

export const refusedRecord = function refusedRecord(
    subject: string,
    kind: string,
    id: string,
    defects: readonly string[],
): string {
    return `${subject}: the ${kind} "${id}" ${defects.join("; ")}`;
};

export const outsideVocabulary = function outsideVocabulary(
    subject: string,
    value: string,
    values: readonly string[],
): string {
    return `${subject} declares "${value}", and its vocabulary declares only ${values.join(", ")}`;
};
```
