We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 0b7ba05 commit 44364caCopy full SHA for 44364ca
helpers/each.js
@@ -103,6 +103,7 @@ module.exports = (handlebars) => {
103
104
if (i === 0) {
105
ret = inverse(this)
106
+ ret = [inverse(this)]
107
}
108
109
return ret.join('')
test/test.js
@@ -344,6 +344,14 @@ describe('Test async helpers', () => {
344
should.equal(result, expected)
345
})
346
347
+ it('Test each helper with an empty item list', async () => {
348
+ const hbs = asyncHelpers(Handlebars)
349
+
350
+ const items = [],
351
+ result = await hbs.compile('Devs \n{{#each items}}{{/each}}')({items})
352
+ should.equal(result, 'Devs \n')
353
+ })
354
355
it('check version', () => {
356
const hbs = asyncHelpers(Handlebars)
357
should(hbs.ASYNC_VERSION).equal(require('../package.json').version)
0 commit comments