3.15.0 • Published 9 months ago

@baloise/web-app-pipes v3.15.0

Weekly downloads
-
License
Apache-2.0
Repository
github
Last release
9 months ago

@baloise/web-app-pipes

Continuous Release npm npm bundle size npm GitHub GitHub issues

Installation

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.

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

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

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

balCapitalize

balCapitalize(value: any) => string

Transforms the given string parameter to capitalize string.

balCapitalize('baloise') // Baloise

balClaimNumber

balClaimNumber(value: any) => string

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

balClaimNumber('73001217169') // 73/001217/16.9

balContractNumber

balContractNumber(value: any) => string

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

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.

balCurrency(1234567.89) // 1'234'567.89

balDateString

balDateString(value: any) => string

Transforms the given string parameter to capitalize string.

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 ('-').

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

balFileSize

balFileSize(value: number) => string

Transforms the filesize in human readable string.

balFileSize(86956565) // 82.9 MB

balHighlight

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

Transforms the given text into a highlighted html content.

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.

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.

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

balLimit

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

Limits the input string.

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.

balOfferNumber('987654321') // 98/7.654.321

balPhoneNumber

balPhoneNumber(value: any) => string

Formats the given phone.

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

9 months ago

3.14.0

10 months ago

3.11.4

1 year ago

3.11.3

1 year ago

3.11.2

2 years ago

3.10.1

2 years ago

3.10.0

2 years ago

3.11.0

2 years ago

3.11.1

2 years ago

3.9.0

2 years ago

3.7.1-beta.302

3 years ago

3.7.1-beta.304

3 years ago

3.7.1-beta.303

3 years ago

3.7.1-beta.305

3 years ago

3.7.3

3 years ago

3.7.2

3 years ago

3.8.0

3 years ago

3.6.4

3 years ago

3.6.3

3 years ago

3.7.2-beta.1

3 years ago

3.7.1

3 years ago

3.7.0

3 years ago

3.3.2-beta.4

3 years ago

3.3.2-beta.7

3 years ago

3.3.2-beta.8

3 years ago

3.3.2-beta.5

3 years ago

3.3.2-beta.6

3 years ago

3.3.2-beta.9

3 years ago

3.3.2-beta.20

3 years ago

3.3.2-beta.22

3 years ago

3.3.2-beta.24

3 years ago

3.3.2-beta.23

3 years ago

3.6.2

3 years ago

3.6.1

3 years ago

3.6.0

3 years ago

3.3.2-beta.14

3 years ago

3.3.2-beta.17

3 years ago

3.3.2-beta.16

3 years ago

3.3.2-beta.19

3 years ago

3.3.2-beta.18

3 years ago

3.3.2-beta.13

3 years ago

3.5.0

3 years ago

3.4.0

3 years ago

3.3.1

3 years ago

3.3.0

3 years ago

3.2.1

3 years ago

3.3.3

3 years ago

3.3.2

3 years ago

3.1.0

3 years ago

3.0.1

3 years ago

3.0.0

3 years ago

2.0.15

3 years ago

2.0.16

3 years ago

2.0.13

3 years ago

2.0.14

3 years ago

2.0.11

3 years ago

2.0.12

3 years ago

2.0.9

3 years ago

2.0.10

3 years ago

2.0.8

4 years ago

2.0.7

4 years ago

2.0.6

4 years ago

2.0.5

4 years ago

2.0.4

4 years ago

2.0.3

4 years ago

2.0.2

4 years ago

2.0.2-beta.3

4 years ago

2.0.1

4 years ago

2.0.0

4 years ago

0.0.1

4 years ago