@@ -4,7 +4,7 @@ module.exports = {
4
4
/**
5
5
* Counts using `component "component-name"` usage in templates
6
6
*
7
- * @param {object } stats
7
+ * @param {object } components
8
8
* @returns {number }
9
9
*/
10
10
countComponentHelpers ( components ) {
@@ -21,7 +21,7 @@ module.exports = {
21
21
* Counts components invocations in JS files.
22
22
* That could happen through `import` or by referring by name in configuration of an script or so.
23
23
*
24
- * @param {object } stats
24
+ * @param {object } components
25
25
* @returns {number }
26
26
*/
27
27
countJsUsage ( components ) {
@@ -37,7 +37,7 @@ module.exports = {
37
37
/**
38
38
* Counts components that were used just once.
39
39
*
40
- * @param {object } stats
40
+ * @param {object } components
41
41
* @returns {number }
42
42
*/
43
43
countUsedJustOnce ( components ) {
@@ -55,7 +55,7 @@ module.exports = {
55
55
/**
56
56
* Creates a breakdown between {{curly-braces}} and <AngleBrackets> components syntax usage.
57
57
*
58
- * @param {object } stats
58
+ * @param {object } components
59
59
* @returns {{curly: number, angle: number, curlyPercentage: number, anglePercentage: number} }
60
60
*/
61
61
curlyVsAngle ( components ) {
@@ -83,18 +83,18 @@ module.exports = {
83
83
*
84
84
* In case of the same number of occurrences for multiple component, the first on the list is returned.
85
85
*
86
- * @param {object } stats
86
+ * @param {object } components
87
87
* @returns {object|null }
88
88
*/
89
89
getTheMostCommon ( components ) {
90
90
let max = null ;
91
91
92
92
for ( const key of Object . keys ( components ) ) {
93
- if ( ! max || max . count < components [ key ] . count ) {
94
- max = components [ key ] . key ;
93
+ if ( ! max || max . stats . count < components [ key ] . stats . count ) {
94
+ max = components [ key ] ;
95
95
}
96
96
}
97
97
98
- return components [ max ] ;
98
+ return max ;
99
99
} ,
100
100
} ;
0 commit comments