UNPKG

cabdriver

Version:

Helps you to fill in your hours with taxi

20 lines (15 loc) 378 B
var _ = require('lodash'); exports.dashed = dashed; exports.filterFloat = filterFloat; function dashed(val) { var splitted = val.split('-'); return _.map(splitted, function(elem) { return elem.trim(); }); } function filterFloat(value) { if (/^(-|\+)?([0-9]+(\.[0-9]+)?|Infinity)$/.test(value)) { return Number(value); } return NaN; }