Skip to content

Commit 03a930c

Browse files
author
Syed Faizan
committed
fixed the es lint errors
1 parent 21ff783 commit 03a930c

File tree

2 files changed

+14
-13
lines changed

2 files changed

+14
-13
lines changed

lib/array.js

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -798,11 +798,12 @@ helpers.withSort = function(array, prop, options) {
798798
return result;
799799
};
800800

801-
helpers.unique = function(array, options){
801+
helpers.unique = function(array, options) {
802802
if (util.isUndefined(array)) return '';
803803

804-
return array.filter( function(item, index, self){
805-
return self.indexOf(item) == index;
804+
return array.filter(function(item, index, self) {
805+
return self.indexOf(item) === index;
806806
});
807807

808-
}
808+
};
809+

test/array.js

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ var helpers = require('..');
77
helpers.array({handlebars: hbs});
88
helpers.string({handlebars: hbs});
99

10-
var context = {array: ['a', 'b', 'c', 'd', 'e', 'f', 'g', 'h'], duplicate: ['a','b','b','c','d','b','f','a','g']};
10+
var context = {array: ['a', 'b', 'c', 'd', 'e', 'f', 'g', 'h'], duplicate: [ 'a', 'b', 'b', 'c', 'd', 'b', 'f', 'a', 'g']};
1111

1212
describe('array', function() {
1313
describe('after', function() {
@@ -480,15 +480,15 @@ describe('array', function() {
480480
});
481481
});
482482

483-
describe('unique', function(){
484-
it('should return empty string when the array is null', function(){
485-
var fn = hbs.compile('{{#unique}}{{this}}{{/unique}}')
486-
assert.equal(fn(context), '');
487-
})
488-
it('should return array with unique items', function(){
483+
describe('unique', function() {
484+
it('should return empty string when the array is null', function() {
485+
var fn = hbs.compile('{{#unique}}{{this}}{{/unique}}');
486+
assert.equal(fn(context), '');
487+
});
488+
it('should return array with unique items', function() {
489489
var fn = hbs.compile('{{#unique duplicate}}{{this}}{{/unique}}');
490-
assert.equal(fn(context).toString(), 'a,b,c,d,f,g');
491-
})
490+
assert.equal(fn(context).toString(), 'a,b,c,d,f,g');
491+
});
492492
});
493493

494494
});

0 commit comments

Comments
 (0)