UNPKG

@aws/pdk

Version:

All documentation is located at: https://aws.github.io/aws-pdk

10 lines (9 loc) 229 B
module.exports = function parseUnit(str, out) { if (!out) out = [ 0, '' ] str = String(str) var num = parseFloat(str, 10) out[0] = num out[1] = str.match(/[\d.\-\+]*\s*(.*)/)[1] || '' return out }