UNPKG

generator-thundr-gae-react

Version:

Yeoman generator for a React app that runs atop Thundr on Google App Engine

16 lines (13 loc) 445 B
import moment from 'moment'; import * as numeral from 'numeral'; import { isNumber } from 'lodash'; const date = (str, defaultVal) => (str && moment(str).format('DD/MM/YYYY')) || defaultVal; const currency = num => num && numeral(num).format('$0,0.00'); const percent = num => isNumber(num) && `${num}%`; const enumSlugify = str => str && str.replace(/_/g, '-').toLowerCase(); export default { date, currency, percent, enumSlugify, };