Sfoglia il codice sorgente

fix exists/not_exists helpers

tags/2.0.1
Jonathan Cobb 4 anni fa
parent
commit
9e059c6d2d
1 ha cambiato i file con 2 aggiunte e 2 eliminazioni
  1. +2
    -2
      src/main/java/org/cobbzilla/util/handlebars/HandlebarsUtil.java

+ 2
- 2
src/main/java/org/cobbzilla/util/handlebars/HandlebarsUtil.java Vedi File

@@ -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 "";


Caricamento…
Annulla
Salva