Skip to content

Commit

Permalink
fix: add lower case helper in node pdf engine
Browse files Browse the repository at this point in the history
  • Loading branch information
alexyey committed Nov 20, 2023
1 parent ac063c6 commit 7a07dd1
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 0 deletions.
9 changes: 9 additions & 0 deletions node/pdf-generate/helpers/lowercase.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
var lowercase = function () {};

lowercase.register = function (Handlebars) {
Handlebars.registerHelper("lowercase", function (str) {
return str.toLowerCase();
});
};

module.exports = lowercase;
2 changes: 2 additions & 0 deletions node/pdf-generate/utils/browserManager.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ let handlebars = require("handlebars");
let splitAndSpace = require('../helpers/splitAndSpace');
let not = require('../helpers/not')
let eq = require('../helpers/eq')
let lowercase = require('../helpers/lowercase');

let browser;

Expand All @@ -13,6 +14,7 @@ const getBrowserSession = async () => {
handlebars.registerHelper("not", not);
handlebars.registerHelper("eq", eq);
handlebars.registerHelper("splitAndSpace", splitAndSpace);
handlebars.registerHelper("lowercase", lowercase);

browser = await puppeteer.launch({
headless: true,
Expand Down

0 comments on commit 7a07dd1

Please sign in to comment.