@donald.ma/utils
An npm package with random functions :)
Last updated a year ago by donald.ma .
ISC · Original npm · Tarball · package.json
$ cnpm install @donald.ma/utils 
SYNC missed versions from official npm registry.

My npm package

An npm package with random functions :)

Installation

npm i donaldma-npm

Stack

Functions

isCurrency

const isCurrency = (str: string): boolean => {
  const cleanedString = str.trim().toUpperCase()
  const isCrypto = Constants.cryptocurrencies[cleanedString] ? true : false
  const isFiat = Constants.fiatCurrenciesData.includes(cleanedString)

  return isCrypto || isFiat
}

const isNumeric = (value: any): boolean => {
  return !isNaN(parseFloat(value)) && isFinite(value)
}

const jsonToQueryString = (json: object): string => {
  return Object.keys(json).filter((key) => json[key] !== undefined).map((key) => {
    return encodeURIComponent(key) + '=' + encodeURIComponent(json[key])
  }).join('&')
}

Current Tags

  • 1.7.0                                ...           latest (a year ago)

6 Versions

  • 1.7.0                                ...           a year ago
  • 1.6.0                                ...           2 years ago
  • 1.5.0                                ...           2 years ago
  • 1.4.0                                ...           2 years ago
  • 1.3.0                                ...           2 years ago
  • 1.2.0                                ...           2 years ago
Maintainers (1)
Downloads
Today 0
This Week 0
This Month 0
Last Day 0
Last Week 0
Last Month 9
Dependencies (10)
Dev Dependencies (4)
Dependents (0)
None

Copyright 2014 - 2016 © taobao.org |