Open omarangaritaj opened 5 months ago
@omarangaritaj thank you very much, but I'm a bit hesitant for this one. 😅 this is very specific to the mongo library. If I allow this, don't we also need detection of isFirestoreId
? And then the list goes on of services....
What I'm trying to say, I'm not sure I want to integrate service specific functions into is-what
, and keep is-what
more about just vanilla JS/TS/NodeJS
@omarangaritaj thank you very much, but I'm a bit hesitant for this one. 😅 this is very specific to the mongo library. If I allow this, don't we also need detection of
isFirestoreId
? And then the list goes on of services....What I'm trying to say, I'm not sure I want to integrate service specific functions into
is-what
, and keepis-what
more about just vanilla JS/TS/NodeJS
Like a Swiss Army knife, isn't it better to have the tool available if you need it than to need it and not have it?
I just came to your repository because I got tired of doing typo checks: If (new Types.ObjectId('my_mongo_id') )
This commit introduces a new function,
isMongoId
, that checks if a given string is a valid MongoDB ID. The function has been exported in the main index file and includes unit tests to ensure proper validation.