akdubya / dustjs

Asynchronous templates for the browser and node.js
http://akdubya.github.com/dustjs/
MIT License
1.44k stars 131 forks source link

Why filters doesn't work for empty values? #38

Open jifeon opened 12 years ago

jifeon commented 12 years ago

I want always show some variable as boolean, even it's undefined. I wrote filter:

dust.filters.b = function( value ){
  return value ? 'true' : 'false';
}

and used it:

{some_variable|b}

but undefined and false shown as empty string.