This is the problem you've been trying to interest me in, that I've been studiously ignoring? You say because it's a string, not an integer, when used as a boolean "0" tests as true where 0 would test as false?
I ignored your PM the other day because I looked at that function of yours and didn't think it was testing what you think it is testing. OTOH, if your function there is right it implies I've forgotten even more than I thought I had, which is a lot.
So either way I'm not game to change the script in Undocumented Launch until someone spoon feeds me the exact fix necessary.
"There are large, white swans, and there are small, black swans," he explained, "But there are no medium-sized swans, and there are no grey swans. The non-existence of grey swans mitigates against belief in Mr Darwin's theory."
I understand if you're not interested. You don't have to be! It just seems like a bug. It might not be (I'm not 100% sure), but if it is, I don't like bugs. Bugs must be squished. With extreme prejudice. (Take that, evil bug).
And yes, doing a boolean test of a string containing "0", "1" or "2" all returns true.
try typeof market[prop].legality_export
instead of Object.prototype.toString.call(market[prop].legality_export))
Yes, that's what I thought, too. But as I said, I'm too long out of it to be sure.
"There are large, white swans, and there are small, black swans," he explained, "But there are no medium-sized swans, and there are no grey swans. The non-existence of grey swans mitigates against belief in Mr Darwin's theory."
Where there's a very direct translation from plist to core structure to JS structure like that, everything is a string, and you should use parseInt or parseFloat if it needs to be read as a number.