@@ -8,21 +8,21 @@ const ZERO = 0
8
8
* Simple function convert in boolean any value and return true if its value was truthy
9
9
* @private
10
10
* @param {* } v - anything
11
- * @returns { Boolean } true if truthy
11
+ * @returns { boolean } true if truthy
12
12
*/
13
13
const isTruthy = v => ! ! v
14
14
15
15
/**
16
16
* Get the max value from a list of arguments filtering the falsy values
17
17
* @private
18
- * @param {...Number } args - list of numbers
19
- * @returns { Number } the highest value
18
+ * @param {...number } args - list of numbers
19
+ * @returns { number } the highest value
20
20
*/
21
- const max = ( ...args ) => Math . max ( ZERO , ...args . filter ( isTruthy ) , ZERO )
21
+ const max = ( ...args ) => Math . max ( ZERO , ...args . filter ( isTruthy ) , ZERO ) // eslint-disable-line
22
22
23
23
/**
24
24
* Return the size of the scrollbar that depends on the browser or device used on the client
25
- * @returns { Number } - the browser scrollbar width
25
+ * @returns { number } - the browser scrollbar width
26
26
*/
27
27
export function scrollbarWidth ( ) {
28
28
// Create the measurement node
@@ -46,7 +46,7 @@ export function scrollbarWidth() {
46
46
47
47
/**
48
48
* Get the height of the whole page
49
- * @returns { Number } height in px of the document
49
+ * @returns { number } height in px of the document
50
50
*/
51
51
export function documentHeight ( ) {
52
52
return max (
@@ -60,7 +60,7 @@ export function documentHeight() {
60
60
61
61
/**
62
62
* Get the width of the whole page
63
- * @returns { Number } width in px of the document
63
+ * @returns { number } width in px of the document
64
64
*/
65
65
export function documentWidth ( ) {
66
66
return max (
@@ -74,7 +74,7 @@ export function documentWidth() {
74
74
75
75
/**
76
76
* Return amount of px scrolled from the top of the document
77
- * @returns { Number } scroll top value in px
77
+ * @returns { number } scroll top value in px
78
78
*/
79
79
export function scrollTop ( ) {
80
80
return max (
@@ -86,7 +86,7 @@ export function scrollTop() {
86
86
87
87
/**
88
88
* Return amount of px scrolled from the left of the document
89
- * @returns { Number } scroll left value in px
89
+ * @returns { number } scroll left value in px
90
90
*/
91
91
export function scrollLeft ( ) {
92
92
return max (
@@ -100,7 +100,7 @@ export function scrollLeft() {
100
100
/**
101
101
* Get the offset top of any DOM element
102
102
* @param { HTMLElement } el - the element we need to check
103
- * @returns { Number } the element y position in px
103
+ * @returns { number } the element y position in px
104
104
*/
105
105
export function elementOffsetTop ( el ) {
106
106
return max ( scrollTop ( ) + el . getBoundingClientRect ( ) . top )
@@ -109,7 +109,7 @@ export function elementOffsetTop(el) {
109
109
/**
110
110
* Get the offset left of any DOM element
111
111
* @param { HTMLElement } el - the element we need to check
112
- * @returns { Number } the element x position in px
112
+ * @returns { number } the element x position in px
113
113
*/
114
114
export function elementOffsetLeft ( el ) {
115
115
return max ( scrollLeft ( ) + el . getBoundingClientRect ( ) . left )
0 commit comments