The library has several formating options, which is nice, however it only understands one of them when you "parse" a string with the from() method, which is weird.
Steps to reproduce:
const MUUID = require('uuid-mongodb');
const uuid1 = MUUID.v4();
console.log(uuid1); // Binary { ... }
const string = uuid1.toString('N');
console.log(string); // 9cea27b4d0e44781826ede1b6f378d6f
const uuid2 = MUUID.from(string); // Error: Invalid UUID
An optional parsing parameter like we have in the toString method would make a lot of sense, e.g. MUUID.from(string, 'N');
The library has several formating options, which is nice, however it only understands one of them when you "parse" a string with the
from()method, which is weird.Steps to reproduce:
An optional parsing parameter like we have in the
toStringmethod would make a lot of sense, e.g.MUUID.from(string, 'N');