[**Documentation**](../../../../README)

***

[Documentation](../../../../README) / [@zerotal/core](../../README) / [helpers](../README) / pipe

# Function: pipe()

> **pipe**\<`T`, `R`\>(`value`, `fn`): `R`

Defined in: [helpers/index.ts:176](https://github.com/zerotaldev/zerotal/blob/1d6fb26b05b18ba077de1bfaeb46c42131cd8b70/packages/core/src/helpers/index.ts#L176)

Pass a value to a transformation function and return its result.
The sibling of tap — use pipe when the value should change, tap when it shouldn't.

## Type Parameters

### T

`T`

### R

`R`

## Parameters

### value

`T`

### fn

(`val`) => `R`

## Returns

`R`

## Example

```ts
const slug = pipe(post.title, (t) => t.toLowerCase().replace(/\s+/g, '-'));
```
