# @baloise/web-app-pipes

> Utilities for Baloise Web Applications

Latest version **3.17.4** (published 2026-07-01) · Apache-2.0 license · 0 weekly downloads

## Install

```sh
npm install @baloise/web-app-pipes
pnpm add @baloise/web-app-pipes
yarn add @baloise/web-app-pipes
bun add @baloise/web-app-pipes
```

## Health

**Score 65/100 (B)** — status: active.

Positive: has types; esm support; no vulnerabilities; high maintenance score; high quality score.

Warnings: low downloads.

## Facts

| | |
|---|---|
| Version | 3.17.4 |
| Published | 2026-07-01 |
| First published | 2021-11-19 |
| Weekly downloads | 0 |
| License | Apache-2.0 |
| TypeScript types | bundled |
| Module format | ESM + CommonJS |
| Dependencies | 5 |
| Unpacked size | 76.7 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 3 |
| Maintainers | yannickholzenkamp, baopso, hirsch88, nobilo, team_mortal, madalina.iacob, montakasparsone, assistentenitch |

## Links

- npm: https://www.npmjs.com/package/@baloise/web-app-pipes
- Repository: https://github.com/baloise/web-app-utils
- Issues: https://github.com/baloise/web-app-utils/issues
- npm.io page: https://npm.io/package/@baloise/web-app-pipes

## Dependencies (5)

- [lodash.round](https://npm.io/package/lodash.round.md) ^4.0.4
- [lodash.isarray](https://npm.io/package/lodash.isarray.md) ^4.0.0
- [lodash.isstring](https://npm.io/package/lodash.isstring.md) ^4.0.1
- [lodash.capitalize](https://npm.io/package/lodash.capitalize.md) ^4.2.1
- [@baloise/web-app-utils](https://npm.io/package/@baloise/web-app-utils.md) ^3.17.4

## Recent versions

- 3.17.4 (latest) — 2026-07-01
- 3.7.2-beta.1 (beta) — 2022-11-15
- 3.17.3 — 2026-07-01
- 3.17.2 — 2026-03-23
- 3.17.1 — 2026-03-23
- 3.16.5 — 2025-12-09
- 3.16.4 — 2025-12-09
- 3.16.3 — 2025-12-09
- 3.16.1 — 2025-05-16
- 3.16.0 — 2025-04-10
- 3.15.0 — 2024-09-12
- 3.14.0 — 2024-08-22
- 3.11.4 — 2024-01-30
- 3.11.3 — 2024-01-15
- 3.11.2 — 2023-09-11
- … 64 more at https://npm.io/package/@baloise/web-app-pipes/versions

## README

# @baloise/web-app-pipes

[![Continuous](https://github.com/baloise/web-app-utils/actions/workflows/continuous.yml/badge.svg?branch=master)](https://github.com/baloise/web-app-utils/actions/workflows/continuous.yml)
[![Release](https://github.com/baloise/web-app-utils/actions/workflows/release.yml/badge.svg?branch=master)](https://github.com/baloise/web-app-utils/actions/workflows/release.yml)
![npm](https://img.shields.io/npm/v/@baloise/web-app-pipes)
![npm bundle size](https://img.shields.io/bundlephobia/min/@baloise/web-app-pipes)
![npm](https://img.shields.io/npm/dt/@baloise/web-app-pipes)
![GitHub](https://img.shields.io/github/license/baloise/web-app-utils)
![GitHub issues](https://img.shields.io/github/issues/baloise/web-app-utils)

## Installation

```bash
npm install @baloise/web-app-pipes
```

## Usage

Use pipe function to transform any kind of data to a display format.
The pipe are simple functions which always return a string.
Just import the function and use it to transform data in to readable strings.

- [Angular usage of pipes](../pipes-angular/README.md)
- [Vue usage of pipes](../pipes-vue/README.md)

```typescript
import { balCapitalize } from '@baloise/web-app-pipes'

balCapitalize('baloise')
// returns 'Baloise'
```

<!-- generated content -->

## API

### balBlobToUrl

`balBlobToUrl(value: Blob) => string`

Transforms the given blob parameter to object URL string.

For more information look up the documentation about
[URL.createObjectURL](https://developer.mozilla.org/en-US/docs/Web/API/URL/createObjectURL)

### balCapitalize

`balCapitalize(value: any) => string`

Transforms the given string parameter to capitalize string.

```typescript
balCapitalize('baloise') // Baloise
```

### balClaimNumber

`balClaimNumber(value: any) => string`

Transforms the given string into the correct claim-number format.

```typescript
balClaimNumber('73001217169') // 73/001217/16.9
balClaimNumber('412345678221') // 4.12345678.22.1 // L.NNNNNNNN.JJ.P
balClaimNumber('400045678221') // 4.45678.22.1
balClaimNumber('400045678021') // 4.45678.2.1
balClaimNumber('400045678020') // 4.45678.2.0
```

### balContractNumber

`balContractNumber(value: any) => string`

Transforms the given string into the correct police-number format.

```typescript
balContractNumber('501222333') // 50/1.222.333
```

### balCurrency

`balCurrency(value: any, currencySign: any, showZero: any, decimalLength: any) => string`

Formats the number into a human readable currency string.

```typescript
balCurrency(1234567.89) // 1'234'567.89
```

### balDateString

`balDateString(value: any) => string`

Transforms the given string parameter to capitalize string.

```typescript
balDateString(new Date(2022, 11, 31)) // '2022-12-31'
```

### balDefaultString

`balDefaultString(value: any, defaultString: any) => string`

If the value is empty it shows a dash ('-').

```typescript
balDefaultString('') // -\n
balDefaultString('text') // text
```

### balFileSize

`balFileSize(value: number) => string`

Transforms the filesize in human readable string.

```typescript
balFileSize(86956565) // 82.9 MB
```

### balHighlight

`balHighlight(value: string, search: string, cssClass: any) => string`

Transforms the given text into a highlighted html content.

```typescript
balHighlight('Some Text') // <span class="bal-highlight">Some Text</span>
```

### balHighlightStartsWith

`balHighlightStartsWith(value: string, search: string, cssClass: any) => string`

Transforms the given text into a highlighted html content.

```typescript
balHighlightStartsWith('Some Text', 'Some') // <span class="bal-highlight">Some</span> Text
```

### balJoinArray

`balJoinArray(value: any, delimiter: any) => string`

Transforms the given string array in to a string.

```typescript
balJoinArray(['Apple', 'Potato', 'Bacon']) // Apple, Potato, Bacon
```

### balLimit

`balLimit(value: any, limit: any) => string`

Limits the input string.

```typescript
balLimit('Some string that is ways to long to be rendered') // Some string that is ...
```

### balOfferNumber

`balOfferNumber(value: any, varianteNr: string) => string`

Transforms the input string into a offer number.

```typescript
balOfferNumber('987654321') // 98/7.654.321
```

### balPhoneNumber

`balPhoneNumber(value: any) => string`

Formats the given phone.

```typescript
balPhoneNumber('41,41564410808') // +41 56 441 08 08
balPhoneNumber({ countryCode: '41', phoneNumber: '564410808' }) // +41 56 441 08 08
```

---
_Source: https://npm.io/package/@baloise/web-app-pipes · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
