Completed
Push — master ( 4eae54...b72a16 )
by Andres
01:12
created

angular.filter(ꞌkeylengthꞌ)   A

Complexity

Conditions 2
Paths 1

Size

Total Lines 6

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
cc 2
c 1
b 0
f 0
nc 1
dl 0
loc 6
rs 9.4285
nop 1
1
'use strict';
2
3
angular.module('game', ['ngAnimate', 'ui.router'])
4
.filter('keylength', function(){
5
  return function(input){
6
    if(!angular.isObject(input)){
7
      throw Error('Usage of non-objects with keylength filter!!');
8
    }
9
    return Object.keys(input).length;
10
  };
11
});
12