Skip to content

Commit bab628e

Browse files
committed
Update dependencies
Showed new linting errors, so they were fixed too
1 parent 8e15838 commit bab628e

File tree

5 files changed

+20
-16
lines changed

5 files changed

+20
-16
lines changed

example.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
const {match} = require('./')
1+
const { match } = require('./')
22

33
const testData = [
44
{
@@ -43,5 +43,5 @@ const uasToIdentify = [
4343
const matchMyKnownDevices = match(testData)
4444
uasToIdentify
4545
.map(matchMyKnownDevices)
46-
.map(({brand, model}) => `${brand}-${model}`)
46+
.map(({ brand, model }) => `${brand}-${model}`)
4747
.forEach((device) => console.log(device))

package.json

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -19,13 +19,17 @@
1919
},
2020
"homepage": "https://github.com/bbc/melanite#README",
2121
"dependencies": {
22-
"glob": "^7.1.1",
23-
"levenshtein-edit-distance": "^1.0.0",
24-
"ramda": "0.23.0"
22+
"levenshtein-edit-distance": "^2.0.3",
23+
"ramda": "0.26.1"
2524
},
2625
"devDependencies": {
2726
"chai": "^3.5.0",
28-
"mocha": "^3.2.0",
29-
"standard": "^8.6.0"
27+
"mocha": "^6.0.2",
28+
"standard": "^12.0.1"
29+
},
30+
"standard": {
31+
"ignore": [
32+
"/lib"
33+
]
3034
}
3135
}

src/match.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
'use strict'
22
const score = require('levenshtein-edit-distance')
3-
const {all, any, not, compose, apply, curry, pluck} = require('ramda')
3+
const { all, any, not, compose, apply, curry, pluck } = require('ramda')
44

55
// includesAll :: String -> [String] -> Boolean
66
const includesAll = (haystack, needles) =>
@@ -38,9 +38,9 @@ const findBestMatch = curry((ua, matches) => {
3838
const scores = fuzzies.map((fuzzy) => score(ua, fuzzy))
3939
const bestScoreIndex = scores.indexOf(best(scores))
4040

41-
const device = matches[bestScoreIndex] || {brand: 'generic', model: 'device', type: 'unknown'}
41+
const device = matches[bestScoreIndex] || { brand: 'generic', model: 'device', type: 'unknown' }
4242

43-
return {brand: device.brand, model: device.model, type: device.type}
43+
return { brand: device.brand, model: device.model, type: device.type }
4444
})
4545

4646
// bestMatch :: [matcher] -> ua -> device

test/example.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/* globals describe it */
2-
const {expect} = require('chai')
2+
const { expect } = require('chai')
33

44
describe('example file', () => {
55
let oldConsole

test/matcher.js

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
/* globals describe it beforeEach */
2-
const {expect} = require('chai')
3-
const {match} = require('../')
2+
const { expect } = require('chai')
3+
const { match } = require('../')
44

55
describe('Device Matching', () => {
66
let testData
@@ -27,11 +27,11 @@ describe('Device Matching', () => {
2727
const chromeUA = 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_11_5) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/55.0.2883.95 Safari/537.36'
2828
const madeupDeviceUa = 'Mozzarella file box goodle ultron'
2929

30-
expect(matchUserAgents(chromeUA)).to.deep.equal({brand: 'google', model: 'chrome', type: 'unknown'})
31-
expect(matchUserAgents(madeupDeviceUa)).to.deep.equal({brand: 'flux', model: 'profesh', type: 'tv'})
30+
expect(matchUserAgents(chromeUA)).to.deep.equal({ brand: 'google', model: 'chrome', type: 'unknown' })
31+
expect(matchUserAgents(madeupDeviceUa)).to.deep.equal({ brand: 'flux', model: 'profesh', type: 'tv' })
3232
})
3333
it('Returns generic device if the device is not found', () => {
3434
const modifiedFirefoxUA = 'Mozilla/5.0 (Macintosh; Intel Mac OS Y 10.11; rv:50.0) Gecko/20100101 Firefox/50.0 Chromelike but not/Safari/536.36'
35-
expect(matchUserAgents(modifiedFirefoxUA)).to.deep.equal({brand: 'generic', model: 'device', type: 'unknown'})
35+
expect(matchUserAgents(modifiedFirefoxUA)).to.deep.equal({ brand: 'generic', model: 'device', type: 'unknown' })
3636
})
3737
})

0 commit comments

Comments
 (0)