New Research: Supply Chain Attack on Axios Pulls Malicious Dependency from npm.Details
Socket
Book a DemoSign in
Socket

ock-helpers

Package Overview
Dependencies
Maintainers
1
Versions
3
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

ock-helpers

A collection of helpers to boost the development speed and code share

latest
Source
npmnpm
Version
1.0.4
Version published
Weekly downloads
13
Maintainers
1
Weekly downloads
 
Created
Source

Ock Helpers

A collection of helpers to boost the development speed and code share

Installation

Use npm or yarn

yarn add bla
npm install bla

Usage

import foobar

foobar.pluralize('word') # returns 'words'
foobar.pluralize('goose') # returns 'geese'
foobar.singularize('phenomena') # returns 'phenomenon'

Features

Currency

To parse/format money using the pt-br/BRL currency

addCurrency

Add a R$ BRL currency if necessary

  • Adds R$ prefix
const withPrefix = addCurrency('20.0')
// return will be: R$ 20.0

parseCurrencyToABNT

Format a number (float) to a BRL currency according to ABNT

  • Convert dots to commas
  • Adds R$ prefix
  • Adds 0 at end if necessary
const abntFormat = parseCurrencyToABNT('20.0')
// return will be: R$ 20,00

parseCurrencyToFloat

Converts a string on BRL currency format to float

  • Convert commas to dots
  • Removes R$ prefix
  • Removes the 0 at end if exists
const floatCurrency = parseCurrencyToFloat('R$ 20,00')
// return will be: 20.0

License

MIT

Keywords

helpers

FAQs

Package last updated on 07 Mar 2020

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts