FazBrowse GitHub Viewer | Trending |
URL:
| Home
Tools: [Download Repo ZIP]   [Original HTTPS Page]

Introduce thisInfo filter for functions in templates · samuela/nodegit@5944bbc · GitHub

Repository navigation

Commit 5944bbc

Browse files
committed
Introduce thisInfo filter for functions in templates
1 parent 026f0af commit 5944bbc

2 files changed

Lines changed: 9 additions & 0 deletions

File tree

‎generate/scripts/generateNativeCode.js‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -75,6 +75,7 @@ module.exports = function generateNativeCode() {
7575
returnsCount: require("../templates/filters/returns_count"),
7676
returnsInfo: require("../templates/filters/returns_info"),
7777
subtract: require("../templates/filters/subtract"),
78+
thisInfo: require("../templates/filters/this_info"),
7879
titleCase: require("../templates/filters/title_case"),
7980
toBool: require('../templates/filters/to_bool'),
8081
toSizeOfArray: require("../templates/filters/to_size_of_array"),
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
module.exports = function(args, fieldToRetrieve) {
2+
const thisArg = args.find(arg => arg.isSelf);
3+
if (thisArg) {
4+
return thisArg[fieldToRetrieve];
5+
}
6+
7+
return;
8+
};

0 commit comments

Comments
 (0)

Back | FazBrowse Home | New Git URL