npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

@baloise/web-app-pipes

v3.11.4

Published

Utilities for Baloise Web Applications

Downloads

194

Readme

@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