mustache icon indicating copy to clipboard operation
mustache copied to clipboard

Allow missing keys when inv and lenient=true

Open alkebuware opened this issue 3 years ago • 3 comments

I encountered a bug where if a key wasn't listed in the map passed to renderString then an exception would be thrown even though lenient was true.

I've relaxed the type requirements of pop() method as this is where the exception as throwing since _stack can have dynamic values but the return value of pop() was non-nullable.

Now the inversion symbol {{^email2}}{{email}}{{/email2}} works as expected and prints the interpolated value of email.

alkebuware avatar Oct 01 '21 04:10 alkebuware

I arrived at this same conclusion independently... Should have checked the PRs first :) Please merge this as it's a pretty straightforward and needed solution!

Calpoog avatar Aug 05 '22 13:08 Calpoog

Ah great, another abandoned dart library, @jonahwilliams would you be kind enough to merge and publish this so I don't have to make a duplicate package for one trivial line of code change?

davidpanic avatar Dec 23 '22 15:12 davidpanic

@jonahwilliams Thanks for this amazing library. Can you spend some time closing each of these PRs?

codekeyz avatar Dec 09 '23 18:12 codekeyz