patrickkettner / filesize-parser

convert human readable filesizes to their byte equivalent
25 stars 12 forks source link

Sometimes returns a string #9

Closed callumlocke closed 8 years ago

callumlocke commented 8 years ago
const parseFilesize = require('filesize-parser');

// this returns the number 1024, as expected
parseFilesize('1kb');

// expected this to return the same thing, but it returns "1024" as a string
parseFilesize(1024);

live demo: https://tonicdev.com/callumlocke/filesize-parser-string-bug