Skip to content

Commit 46a3cbf

Browse files
committed
style(*): src/
1 parent 39bb5c3 commit 46a3cbf

35 files changed

+67
-161
lines changed

src/_filter/boolean/is-null.js

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,9 +7,7 @@
77
* checks if value is null or not
88
* @return Boolean
99
*/
10-
1110
angular.module('a8m.is-null', [])
12-
1311
.filter('isNull', function () {
1412
return function(input) {
1513
return isNull(input);

src/_filter/collection/before-where.js

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,6 @@
66
* @description
77
* get a collection and properties object, and returns all of the items
88
* in the collection before the first that found with the given properties.
9-
*
109
*/
1110
angular.module('a8m.before-where', [])
1211
.filter('beforeWhere', function() {

src/_filter/collection/concat.js

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,9 +5,7 @@
55
*
66
* @description
77
* get (array/object, object/array) and return merged collection
8-
*
98
*/
10-
119
angular.module('a8m.concat', [])
1210
//TODO(Ariel):unique option ? or use unique filter to filter result
1311
.filter('concat', [function () {

src/_filter/collection/contains.js

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,6 @@
66
* @description
77
* Checks if given expression is present in one or more object in the collection
88
*/
9-
109
angular.module('a8m.contains', [])
1110
.filter({
1211
contains: ['$parse', containsFilter],

src/_filter/collection/defaults.js

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,6 @@
66
* @description
77
* defaultsFilter allows to specify a default fallback value for properties that resolve to undefined.
88
*/
9-
109
angular.module('a8m.defaults', [])
1110
.filter('defaults', ['$parse', function( $parse ) {
1211
return function(collection, defaults) {

src/_filter/collection/first.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,9 +11,9 @@ angular.module('a8m.first', [])
1111
.filter('first', ['$parse', function( $parse ) {
1212
return function(collection) {
1313

14-
var n,
15-
getter,
16-
args;
14+
var n
15+
, getter
16+
, args;
1717

1818
collection = (isObject(collection))
1919
? toArray(collection)

src/_filter/collection/is-empty.js

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6,12 +6,11 @@
66
* @description
77
* get collection or string and return if it empty
88
*/
9-
109
angular.module('a8m.is-empty', [])
1110
.filter('isEmpty', function () {
1211
return function(collection) {
13-
return (isObject(collection)) ?
14-
!toArray(collection).length :
15-
!collection.length;
12+
return (isObject(collection))
13+
? !toArray(collection).length
14+
: !collection.length;
1615
}
1716
});

src/_filter/collection/last.js

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,6 @@
1010
angular.module('a8m.last', [])
1111
.filter('last', ['$parse', function( $parse ) {
1212
return function(collection) {
13-
1413
var n
1514
, getter
1615
, args
@@ -30,10 +29,10 @@ angular.module('a8m.last', [])
3029
n = (isNumber(args[0])) ? args[0] : 1;
3130
getter = (!isNumber(args[0])) ? args[0] : (!isNumber(args[1])) ? args[1] : undefined;
3231

33-
return (args.length) ?
32+
return (args.length)
3433
//send reversed collection as arguments, and reverse it back as result
35-
getFirstMatches(reversed.reverse(), n,(getter) ? $parse(getter) : getter).reverse() :
34+
? getFirstMatches(reversed.reverse(), n,(getter) ? $parse(getter) : getter).reverse()
3635
//get the last element
37-
reversed[reversed.length-1];
36+
: reversed[reversed.length-1];
3837
}
3938
}]);

src/_filter/collection/reverse.js

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6,18 +6,17 @@
66
* @description
77
* Reverses a string or collection
88
*/
9-
109
angular.module('a8m.reverse', [])
11-
1210
.filter('reverse',[ function () {
1311
return function (input) {
14-
1512
input = (isObject(input)) ? toArray(input) : input;
1613

1714
if(isString(input)) {
1815
return input.split('').reverse().join('');
1916
}
2017

21-
return (isArray(input)) ? input.slice().reverse() : input;
18+
return isArray(input)
19+
? input.slice().reverse()
20+
: input;
2221
}
2322
}]);

src/_filter/collection/to-array.js

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -9,20 +9,18 @@
99
* $key to the value containing the original key that was used in
1010
* the object we are iterating over to reference the property
1111
*/
12-
1312
angular.module('a8m.to-array', [])
14-
1513
.filter('toArray', function() {
1614
return function (collection, addKey) {
1715

1816
if(!isObject(collection)) {
1917
return collection;
2018
}
2119

22-
return (!addKey) ? toArray(collection) :
23-
24-
Object.keys(collection).map(function (key) {
25-
return extend(collection[key], { $key: key });
26-
});
20+
return !addKey
21+
? toArray(collection)
22+
: Object.keys(collection).map(function (key) {
23+
return extend(collection[key], { $key: key });
24+
});
2725
}
2826
});

0 commit comments

Comments
 (0)