isMongoObjectID
Super fast function to check if a String is a MongoDB ObjectID based on ES6 Sets.
Why?
Because performance does matter.
isMongoObjectID is almost 6x faster than objectid.isValid (from objectid module)
Measurements
We check 2 Strings: one with objectID formant and another with invalid format for each case. (We use performance-node module for measures).
After several execution we get the following results: