[API reference](https://evolu.dev/docs/api-reference) › [@evolu/common](https://evolu.dev/docs/api-reference/common) › [Types](https://evolu.dev/docs/api-reference/common/Types) › Refinement

```ts
type Refinement<A, B> = (a: A) => a is B;
```

Defined in: [packages/common/src/Types.ts:91](https://github.com/evoluhq/evolu/blob/e7144e2bbe9069362b62dec1b64a8aa922b8f1b0/packages/common/src/Types.ts#L91)

A type guard function that refines type `A` to a narrower type `B`.

### Example

```ts
type Animal = { name: string };
type Dog = Animal & { breed: string };

const isDog: Refinement<Animal, Dog> = (animal): animal is Dog =>
  "breed" in animal;

const animal: Animal = { name: "Dog", breed: "Beagle" };
if (isDog(animal)) {
  console.log(animal.breed); // Safe access to `breed`
}
```