Skip to content
This repository was archived by the owner on Feb 20, 2019. It is now read-only.

Commit 6f4f084

Browse files
author
Kent C. Dodds
committed
chore(deps): update all dependencies and configs
Closes #32
1 parent 5d1d0fe commit 6f4f084

11 files changed

+78
-50
lines changed

.travis.yml

+3-5
Original file line numberDiff line numberDiff line change
@@ -8,15 +8,13 @@ branches:
88
- master
99
notifications:
1010
email: false
11-
node_js:
12-
- 4
11+
node_js: 6
1312
before_install:
1413
- npm i -g npm@^3.0.0
1514
before_script:
1615
- npm prune
1716
script:
18-
- npm run cover
19-
- npm run build
17+
- npm run validate
2018
after_success:
21-
- npm run semantic-release
2219
- npm run report-coverage
20+
- npm run semantic-release

package.json

+55-24
Original file line numberDiff line numberDiff line change
@@ -5,15 +5,13 @@
55
"main": "dist/index.js",
66
"scripts": {
77
"commit": "git-cz",
8-
"prebuild": "npm run lint && npm run clean",
9-
"clean": "rimraf dist && mkdir dist",
10-
"cover": "nyc --reporter lcov --reporter text npm t",
11-
"check-coverage": "nyc check-coverage --statements 100 --branches 100 --functions 100 --lines 100",
8+
"prebuild": "rimraf dist",
129
"report-coverage": "cat ./coverage/lcov.info | codecov",
1310
"build": "babel src/ -d dist/",
14-
"test": "ava --require babel-register",
15-
"test:watch": "nodemon --exec npm t",
11+
"test": "cross-env NODE_ENV=test nyc ava",
12+
"test:watch": "ava --watch",
1613
"lint": "eslint src/",
14+
"validate": "npm-run-all lint test build",
1715
"semantic-release": "semantic-release pre && npm publish && semantic-release post"
1816
},
1917
"repository": {
@@ -31,39 +29,72 @@
3129
},
3230
"homepage": "https://github.com/eggheadio-github/stack-overflow-copy-paste#readme",
3331
"devDependencies": {
34-
"ava": "0.13.0",
35-
"babel-cli": "6.6.5",
36-
"babel-preset-es2015": "6.6.0",
37-
"babel-preset-stage-2": "6.5.0",
38-
"babel-register": "6.7.2",
32+
"ava": "0.15.2",
33+
"babel-cli": "6.11.4",
34+
"babel-plugin-istanbul": "1.0.3",
35+
"babel-preset-es2015": "6.9.0",
36+
"babel-preset-stage-2": "6.11.0",
37+
"babel-register": "6.11.6",
3938
"codecov.io": "0.1.6",
40-
"commitizen": "2.7.2",
41-
"cz-conventional-changelog": "1.1.5",
42-
"eslint": "2.4.0",
43-
"eslint-config-kentcdodds": "6.0.0",
44-
"ghooks": "1.0.3",
45-
"nodemon": "1.9.1",
46-
"nyc": "6.1.1",
47-
"rimraf": "2.5.2",
39+
"commitizen": "2.8.2",
40+
"cross-env": "2.0.0",
41+
"cz-conventional-changelog": "1.1.6",
42+
"eslint": "3.2.0",
43+
"eslint-config-kentcdodds": "9.0.0",
44+
"ghooks": "1.3.2",
45+
"nodemon": "1.10.0",
46+
"npm-run-all": "2.3.0",
47+
"nyc": "7.1.0",
48+
"rimraf": "2.5.4",
4849
"semantic-release": "4.3.5",
49-
"validate-commit-msg": "2.4.0"
50+
"validate-commit-msg": "2.6.1"
5051
},
5152
"config": {
5253
"ghooks": {
5354
"commit-msg": "validate-commit-msg",
54-
"pre-commit": "npm run cover && npm run build"
55+
"pre-commit": "npm run validate"
5556
},
5657
"commitizen": {
57-
"path": "node_modules/cz-conventional-changelog"
58+
"path": "cz-conventional-changelog"
5859
}
5960
},
61+
"nyc": {
62+
"all": true,
63+
"check-coverage": true,
64+
"branches": 100,
65+
"function": 100,
66+
"lines": 100,
67+
"statements": 100,
68+
"reporter": [
69+
"text",
70+
"lcov"
71+
],
72+
"include": [
73+
"src"
74+
],
75+
"sourceMap": false,
76+
"instrument": false,
77+
"require": [
78+
"babel-register"
79+
]
80+
},
6081
"babel": {
6182
"presets": [
6283
"es2015",
6384
"stage-2"
64-
]
85+
],
86+
"env": {
87+
"test": {
88+
"plugins": [
89+
"istanbul"
90+
]
91+
}
92+
}
6593
},
6694
"eslintConfig": {
67-
"extends": "kentcdodds"
95+
"extends": [
96+
"kentcdodds",
97+
"kentcdodds/ava"
98+
]
6899
}
69100
}

src/array-fill.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
/* eslint prefer-spread:0 */
12
export default fill
23

34
/**
@@ -12,4 +13,3 @@ export default fill
1213
function fill(array, value) {
1314
return Array.apply(null, array).map(value.constructor.prototype.valueOf, value)
1415
}
15-

src/flatten.js

+3-3
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,8 @@ export default flatten
88
* @param {...Array} arrays - The array(s) to flatten
99
* @return {Array} - The flattened array
1010
*/
11-
function flatten() {
12-
return [].slice.call(arguments).reduce(function flattenReducer(flat, toFlatten) {
13-
return flat.concat(Array.isArray(toFlatten) ? flatten.apply(null, toFlatten) : toFlatten)
11+
function flatten(...args) {
12+
return args.reduce(function flattenReducer(flat, toFlatten) {
13+
return flat.concat(Array.isArray(toFlatten) ? flatten(...toFlatten) : toFlatten)
1414
}, [])
1515
}

src/get-query-string-param.js

+1-2
Original file line numberDiff line numberDiff line change
@@ -11,8 +11,7 @@ export default getQueryStringParam
1111
*/
1212
function getQueryStringParam(url, name) {
1313
const regexReadyName = name.replace(/[\[]/, '\\[').replace(/[\]]/, '\\]')
14-
const regex = new RegExp('[\\?&]' + regexReadyName + '=([^&#]*)')
14+
const regex = new RegExp(`[\\?&]${regexReadyName}=([^&#]*)`)
1515
const results = regex.exec(url)
1616
return results === null ? '' : decodeURIComponent(results[1].replace(/\+/g, ' '))
1717
}
18-

test/array-fill.js

+3-3
Original file line numberDiff line numberDiff line change
@@ -5,21 +5,21 @@ test('fills an array with a number', t => {
55
const original = [1, 2, 3, 4]
66
const expected = [7, 7, 7, 7]
77
const actual = arrayFill(original, 7)
8-
t.same(actual, expected)
8+
t.deepEqual(actual, expected)
99
})
1010

1111
test('fills an array with a string', t => {
1212
const original = Array(4)
1313
const expected = ['wookie', 'wookie', 'wookie', 'wookie']
1414
const actual = arrayFill(original, 'wookie')
15-
t.same(actual, expected)
15+
t.deepEqual(actual, expected)
1616
})
1717

1818
test('fills an array with a boolean', t => {
1919
const original = Array(4)
2020
const expected = [false, false, false, false]
2121
const actual = arrayFill(original, false)
22-
t.same(actual, expected)
22+
t.deepEqual(actual, expected)
2323
})
2424

2525
test.todo('allow for non-primitive values like objects, arrays, and dates')

test/flatten.test.js

+2-2
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ test('flattens an array of arrays', t => {
55
const original = [[1, 2], 3, [4, 5]]
66
const expected = [1, 2, 3, 4, 5]
77
const actual = flatten(original)
8-
t.same(actual, expected)
8+
t.deepEqual(actual, expected)
99
})
1010

1111
test('flattens multiple arrays', t => {
@@ -14,5 +14,5 @@ test('flattens multiple arrays', t => {
1414
const original3 = [true, false, true, false]
1515
const expected = [1, 2, 3, 4, 5, 'A', 'b', 'C', 'd', 'E', true, false, true, false]
1616
const actual = flatten(original1, original2, original3)
17-
t.same(actual, expected)
17+
t.deepEqual(actual, expected)
1818
})

test/get-query-string-param.test.js

+2-2
Original file line numberDiff line numberDiff line change
@@ -7,12 +7,12 @@ test('gets the given parameter', t => {
77
const name = 'utm_campaign'
88
const expected = 'contributing-to-open-source'
99
const actual = getQueryStringParam(url, name)
10-
t.same(actual, expected)
10+
t.deepEqual(actual, expected)
1111
})
1212

1313
test('returns an empty string if param does not exist', t => {
1414
const name = 'missing-thing'
1515
const expected = ''
1616
const actual = getQueryStringParam(url, name)
17-
t.same(actual, expected)
17+
t.deepEqual(actual, expected)
1818
})

test/pad-left.test.js

+3-3
Original file line numberDiff line numberDiff line change
@@ -7,22 +7,22 @@ test('pads left of the given string', t => {
77
const padLength = 5
88
const padWith = 'z'
99
const actual = padLeft(original, padLength, padWith)
10-
t.same(actual, expected)
10+
t.deepEqual(actual, expected)
1111
})
1212

1313
test('defaults to pad a zero', t => {
1414
const original = '123'
1515
const expected = '00123'
1616
const padLength = 5
1717
const actual = padLeft(original, padLength)
18-
t.same(actual, expected)
18+
t.deepEqual(actual, expected)
1919
})
2020

2121
test('does not pad a string longer than the pad length', t => {
2222
const original = '1234'
2323
const expected = '1234'
2424
const padLength = 3
2525
const actual = padLeft(original, padLength)
26-
t.same(actual, expected)
26+
t.deepEqual(actual, expected)
2727
})
2828

test/snake-to-camel.test.js

+2-2
Original file line numberDiff line numberDiff line change
@@ -5,12 +5,12 @@ test('converts snake-case to camelCase', t => {
55
const original = 'snake-case-string'
66
const expected = 'snakeCaseString'
77
const actual = snakeToCamel(original)
8-
t.same(actual, expected)
8+
t.deepEqual(actual, expected)
99
})
1010

1111
test('converts snake_case to camelCase', t => {
1212
const original = 'snake_case_string'
1313
const expected = 'snakeCaseString'
1414
const actual = snakeToCamel(original)
15-
t.same(actual, expected)
15+
t.deepEqual(actual, expected)
1616
})

test/sort-objects-array.test.js

+3-3
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ test('sort an array of objects by ascending order', t => {
1313
{Name:"AAA", Surname:"ZZZ"}
1414
]
1515
const actual = original.slice(0).sort(sortObjectsArray('Surname'))
16-
t.same(actual, expected)
16+
t.deepEqual(actual, expected)
1717
})
1818

1919
test('sort an array of objects by descending order', t => {
@@ -28,7 +28,7 @@ test('sort an array of objects by descending order', t => {
2828
{Name: "Name", Surname: "AAA"}
2929
]
3030
const actual = original.slice(0).sort(sortObjectsArray('-Surname'))
31-
t.same(actual, expected)
31+
t.deepEqual(actual, expected)
3232
})
3333

3434
test('will not sort the an array if the property doesn\'t exist', t => {
@@ -38,6 +38,6 @@ test('will not sort the an array if the property doesn\'t exist', t => {
3838
{Name: "Name", Surname: "AAA"}
3939
]
4040
const actual = original.slice(0).sort(sortObjectsArray('Middle'))
41-
t.same(actual, original)
41+
t.deepEqual(actual, original)
4242
})
4343

0 commit comments

Comments
 (0)