Skip to content

Request to make validation optional for Stringify OR export unsafeStringify #663

Answered by broofa
vineet-sh asked this question in Q&A
Discussion options

You must be logged in to vote

Either export the unsafeStringify as a separate API

My rationale for why we shouldn't do this. tl;dr: it increases the maintenance burden.

Or make validation part in stringify as optional

I appreciate that bytesToUuid() used to take any 16-byte array, but uuid is no longer in the business of generating or otherwise working with invalid UUIDs. That it complains loudly and early upon encountering a bad UUID is, to my mind, a good thing. It allows us to keep the code and public API focused, and helps users quickly identify issues with upstream code. (Instead of, for example, allowing stringify() to generate invalid UUIDs that might propagate into DB tables, URLs, etc.)

Replies: 2 comments 2 replies

Comment options

You must be logged in to vote
1 reply
@vineet-sh
Comment options

Comment options

You must be logged in to vote
1 reply
@vineet-sh
Comment options

Answer selected by vineet-sh
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
3 participants