Skip to content

Commit

Permalink
Merge pull request #98 from agreatfool/fix-remove-handlebars-helpers
Browse files Browse the repository at this point in the history
Remove lib handlebars-helpers
  • Loading branch information
agreatfool authored Apr 11, 2021
2 parents b0d5a6e + 61e634a commit d3b796d
Show file tree
Hide file tree
Showing 5 changed files with 21 additions and 1,271 deletions.
10 changes: 8 additions & 2 deletions build/lib/TplEngine.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion build/lib/TplEngine.js.map

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 1 addition & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -29,8 +29,7 @@
"homepage": "https://github.com/agreatfool/grpc_tools_node_protoc_ts#readme",
"dependencies": {
"google-protobuf": "3.15.8",
"handlebars": "4.7.6",
"handlebars-helpers": "0.10.0"
"handlebars": "4.7.6"
},
"devDependencies": {
"@types/google-protobuf": "3.7.4",
Expand Down
10 changes: 8 additions & 2 deletions src/lib/TplEngine.ts
Original file line number Diff line number Diff line change
@@ -1,9 +1,15 @@
import * as LibFs from "fs";
import * as LibPath from "path";
import * as handlebars from "handlebars";
import * as helpers from "handlebars-helpers";

helpers({handlebars});
handlebars.registerHelper("is", function(arg1, arg2, options) {
/* tslint:disable:triple-equals */
return (arg1 == arg2) ? options.fn(this) : options.inverse(this);
/* tslint:disable:triple-equals */
});
handlebars.registerHelper("eq", function(arg1, arg2, options) {
return (arg1 === arg2) ? options.fn(this) : options.inverse(this);
});
handlebars.registerHelper("curlyLeft", () => {
return "{";
});
Expand Down
Loading

0 comments on commit d3b796d

Please sign in to comment.