-
-
Save panstav/c62b0a3c26117c2743b5f529537afe71 to your computer and use it in GitHub Desktop.
mongoose id normalizer
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
module.exports = function(id){ | |
if (typeof(id) === 'string') return id; | |
if (typeof(id) === 'object') return id.toString(); | |
return undefined; | |
}; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment