Skip to content

Commit 10d0341

Browse files
updated: dependencies and fixed npm audit
1 parent 17f990d commit 10d0341

File tree

4 files changed

+15
-22
lines changed

4 files changed

+15
-22
lines changed

.travis.yml

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -6,12 +6,6 @@ branches:
66
only:
77
- master
88

9-
before_install:
10-
11-
12-
- npm i @gianlucaguarini/[email protected]
13-
14-
159
before_script:
1610
- npm run build
1711

index.next.js

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -8,21 +8,21 @@ const ZERO = 0
88
* Simple function convert in boolean any value and return true if its value was truthy
99
* @private
1010
* @param {*} v - anything
11-
* @returns { Boolean } true if truthy
11+
* @returns { boolean } true if truthy
1212
*/
1313
const isTruthy = v => !!v
1414

1515
/**
1616
* Get the max value from a list of arguments filtering the falsy values
1717
* @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
2020
*/
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
2222

2323
/**
2424
* 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
2626
*/
2727
export function scrollbarWidth() {
2828
// Create the measurement node
@@ -46,7 +46,7 @@ export function scrollbarWidth() {
4646

4747
/**
4848
* 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
5050
*/
5151
export function documentHeight() {
5252
return max(
@@ -60,7 +60,7 @@ export function documentHeight() {
6060

6161
/**
6262
* 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
6464
*/
6565
export function documentWidth() {
6666
return max(
@@ -74,7 +74,7 @@ export function documentWidth() {
7474

7575
/**
7676
* 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
7878
*/
7979
export function scrollTop() {
8080
return max(
@@ -86,7 +86,7 @@ export function scrollTop() {
8686

8787
/**
8888
* 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
9090
*/
9191
export function scrollLeft() {
9292
return max(
@@ -100,7 +100,7 @@ export function scrollLeft() {
100100
/**
101101
* Get the offset top of any DOM element
102102
* @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
104104
*/
105105
export function elementOffsetTop(el) {
106106
return max(scrollTop() + el.getBoundingClientRect().top)
@@ -109,7 +109,7 @@ export function elementOffsetTop(el) {
109109
/**
110110
* Get the offset left of any DOM element
111111
* @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
113113
*/
114114
export function elementOffsetLeft(el) {
115115
return max(scrollLeft() + el.getBoundingClientRect().left)

package.json

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -31,12 +31,12 @@
3131
},
3232
"homepage": "https://github.com/biancojs/viewport#readme",
3333
"devDependencies": {
34-
"@gianlucaguarini/eslint-config": "^1.0.0",
34+
"@gianlucaguarini/eslint-config": "^2.0.0",
3535
"eslint": "^4.19.1",
36-
"jsdom": "11.7.0",
36+
"jsdom": "11.11.0",
3737
"jsdom-global": "3.0.2",
38-
"mocha": "^5.0.5",
39-
"rollup": "^0.57.1",
38+
"mocha": "^5.2.0",
39+
"rollup": "^0.59.4",
4040
"rollup-plugin-node-resolve": "^3.3.0"
4141
}
4242
}

test.js

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
require('jsdom-global')()
22
const assert = require('assert')
33
const viewport = require('./')
4-
const body = document.body
54

65
const notNaN = v => !isNaN(v)
76

0 commit comments

Comments
 (0)