hwookim / storybook-addon-cookie

Set document.cookie for each Storybook.
MIT License
9 stars 4 forks source link

remove redundant stringify #7

Closed aryasaatvik closed 1 year ago

aryasaatvik commented 1 year ago

cookie values should always be strings, not objects. running JSON.stringify wraps the values in redundant quotes.

hwookim commented 1 year ago

That's something I hadn't thought about at all. Thanks for your PR, that's cool! 👍🏼 👍🏼

hwookim commented 1 year ago

While I love the idea of encoding cookies, I realized that this provides unintended behavior for some users. (Like #8 )

Starting with v3.1.0, addon provides the cookieEncoding option. With that option, you can encode the cookies on the panel if you want.

Thanks again for your good PR!