# Decoder

Turns a raw response into features, mapping fields by the definition's
paths. It knows a format, never a provider. It throws when the response is
not in its format at all; single features it cannot read are skipped.

This is a type alias exported by `@mapcairn/core`, checked against version 0.2.0.

## Signature

```ts
import type { Decoder } from "@mapcairn/core";
 
type Decoder = (raw: unknown, fields: FieldMap) => LayerFeature[];
```

## See also

- [`FieldMap`](https://docs.mapcairn.com/api/core/FieldMap.md)
- [`LayerFeature`](https://docs.mapcairn.com/api/core/LayerFeature.md)

Source: [packages/core/src/layers/decoders.ts:19](https://github.com/MapCairn/mapcairn/blob/main/packages/core/src/layers/decoders.ts#L19)
