diff options
Diffstat (limited to 'server/sonar-web/src/main/js/helpers/handlebars/empty.js')
-rw-r--r-- | server/sonar-web/src/main/js/helpers/handlebars/empty.js | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/server/sonar-web/src/main/js/helpers/handlebars/empty.js b/server/sonar-web/src/main/js/helpers/handlebars/empty.js new file mode 100644 index 00000000000..72df1f9ad72 --- /dev/null +++ b/server/sonar-web/src/main/js/helpers/handlebars/empty.js @@ -0,0 +1,6 @@ +import _ from 'underscore'; + +module.exports = function (array, options) { + var cond = _.isArray(array) && array.length > 0; + return cond ? options.inverse(this) : options.fn(this); +}; |