Selaa lähdekoodia

fix exists/not_exists helpers

tags/2.0.1
Jonathan Cobb 4 vuotta sitten
vanhempi
commit
9e059c6d2d
1 muutettua tiedostoa jossa 2 lisäystä ja 2 poistoa
  1. +2
    -2
      src/main/java/org/cobbzilla/util/handlebars/HandlebarsUtil.java

+ 2
- 2
src/main/java/org/cobbzilla/util/handlebars/HandlebarsUtil.java Näytä tiedosto

@@ -264,9 +264,9 @@ public class HandlebarsUtil extends AbstractTemplateLoader {
}
});

hb.registerHelper("exists", (src, options) -> empty(src) ? null : options.apply(options.fn));
hb.registerHelper("exists", (src, options) -> !empty(src) ? null : options.apply(options.fn));

hb.registerHelper("not_exists", (src, options) -> !empty(src) ? null : options.apply(options.fn));
hb.registerHelper("not_exists", (src, options) -> empty(src) ? null : options.apply(options.fn));

hb.registerHelper("sha256", (src, options) -> {
if (empty(src)) return "";


Ladataan…
Peruuta
Tallenna