rxaviers / cldrjs

Simple CLDR traverser

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Empty message content throws E_MISSING_MESSAGE

mateubo opened this issue · comments

Hi,
cldrjs get method throws E_MISSING_MESSAGE error when message content is an empty string.
{ "someProp": "" }.
I'm aware that an empty string is a "falsy" value, but still, it is a valid message content and it should be returned.

That might be a globalize thing since cldrjs doesn't throw that error.

Please, could you file an issue there?

Ah, sorry, the error is indeed thrown by globalize, but the problem is in cldrjs, specifically src/item/lookup.js and quite general if statements there that treat undefined, null, "" in the exactly the same way.

Oh, ok. Reopening then... It indeed should return undefined if the path doesn't exist, but the actual value otherwise. Feel free you like to submit a PR and thanks!

Hi, I submitted a PR for this issue, would you consider accepting it and deploying a new release?

Sorry for the delay, just reviewed it.

I'm sorry for pushing this - I know we are in the middle of the holiday season, please review an updated PR whenever you have the time. Thanks!