Skip to content

Commit 0978b51

Browse files
committed
Update package to fix vulnerabilities
1 parent b731c27 commit 0978b51

37 files changed

+2788
-2569
lines changed

.babelrc

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
{
2-
"presets": ["es2015"]
3-
}
2+
"plugins": ["@babel/plugin-transform-modules-commonjs"]
3+
}

.eslintrc

+3-1
Original file line numberDiff line numberDiff line change
@@ -12,13 +12,15 @@
1212
"chai-friendly/no-unused-expressions": 2,
1313
"comma-dangle": 0,
1414
"consistent-return": 0,
15+
"implicit-arrow-linebreak": 0,
1516
"import/prefer-default-export": 0,
1617
"linebreak-style": 0,
1718
"no-bitwise": 0,
1819
"no-param-reassign": 0,
1920
"no-unnamed-functions": 0,
2021
"no-unused-expressions": 0,
21-
22+
"prefer-promise-reject-errors": 0,
23+
2224
// this is for the tests, don't worrry about it for now
2325
"import/no-unresolved": 1,
2426
"import/extensions": 1

.yarnrc

-6
This file was deleted.

package.json

+21-27
Original file line numberDiff line numberDiff line change
@@ -4,17 +4,12 @@
44
"description": "A wrapper for NodeGit to facilitate LFS Support",
55
"main": "build/src/index.js",
66
"scripts": {
7-
"build": "yarn eslint && yarn compile",
8-
"compile": "\"node_modules/.bin/babel\" src -d build/src",
9-
"eslint": "\"node_modules/.bin/eslint\" src",
10-
"eslint-full": "\"node_modules/.bin/eslint\" src test/tests",
11-
"eslint-quick-fix": "\"node_modules/.bin/eslint\" src test/tests --fix",
12-
"pretest": "yarn eslint",
13-
"prepublish": "yarn eslint && yarn compile",
14-
"src-watch": "\"node_modules/.bin/babel\" src -d build/src -w",
15-
"test": "nyc mocha --compilers js:babel-core/register --expose-gc test/runner \"test/**/*.spec.js\"",
16-
"test-debug": "mocha --debug-brk --compilers js:babel-core/register --expose-gc test/runner \"test/**/*.spec.js\"",
17-
"test-watch": "mocha --compilers js:babel-core/register --expose-gc --watch test/runner \"test/**/*.spec.js\""
7+
"build": "yarn lint && yarn compile",
8+
"compile": "babel src -d build/src",
9+
"lint": "eslint src",
10+
"lint-full": "eslint src test/tests",
11+
"prepublish": "yarn lint && yarn compile",
12+
"test": "nyc mocha --require @babel/register test/runner \"test/**/*.spec.js\""
1813
},
1914
"repository": "[email protected]:Axosoft/nodegit-lfs.git",
2015
"author": "Axosoft, LLC",
@@ -33,28 +28,27 @@
3328
"url": "https://github.com/Axosoft/nodegit-lfs/issues"
3429
},
3530
"homepage": "https://github.com/Axosoft/nodegit-lfs#readme",
36-
"peerDependencies": {
37-
"nodegit": ">=0.25.0-alpha.9"
38-
},
3931
"devDependencies": {
40-
"babel-cli": "^6.24.1",
41-
"babel-core": "^6.25.0",
42-
"babel-preset-es2015": "^6.24.1",
43-
"chai": "^4.0.2",
44-
"eslint": "^3.19.0",
45-
"eslint-config-airbnb-base": "^11.2.0",
46-
"eslint-plugin-chai-friendly": "^0.4.0",
47-
"eslint-plugin-import": "^2.7.0",
48-
"eslint-plugin-mocha": "^4.11.0",
49-
"jsdoc-to-markdown": "^3.0.0",
50-
"mocha": "^3.4.2",
51-
"nyc": "^11.0.3",
32+
"@babel/cli": "^7.8.3",
33+
"@babel/core": "^7.8.3",
34+
"@babel/plugin-transform-modules-commonjs": "^7.8.3",
35+
"@babel/register": "^7.8.3",
36+
"eslint": "^6.8.0",
37+
"eslint-config-airbnb-base": "^14.0.0",
38+
"eslint-plugin-chai-friendly": "^0.5.0",
39+
"eslint-plugin-import": "^2.20.0",
40+
"eslint-plugin-mocha": "^6.2.2",
41+
"chai": "^4.2.0",
42+
"jsdoc-to-markdown": "^5.0.3",
43+
"mocha": "^7.0.0",
44+
"nyc": "^15.0.0",
5245
"prompt": "^1.0.0"
5346
},
5447
"dependencies": {
5548
"default-shell": "^1.0.1",
56-
"fs-extra": "^3.0.1",
49+
"fs-extra": "^8.1.0",
5750
"ignore": "^3.3.3",
51+
"lodash": "^4.17.15",
5852
"promisify-node": "^0.4.0",
5953
"ramda": "^0.24.1",
6054
"uuid": "^3.3.2"

src/callbacks/apply.js

+2-2
Original file line numberDiff line numberDiff line change
@@ -15,10 +15,10 @@ export default (credentialsCallback) => {
1515
const command = `git lfs clean ${ticks}${source.path()}${ticks}`;
1616

1717
return fse.readFile(filePath)
18-
.then(buf => exec(command, buf, { cwd: workdir }));
18+
.then((buf) => exec(command, buf, { cwd: workdir }));
1919
})
2020
.then(({ stdout }) => {
21-
const sha = new Buffer(stdout);
21+
const sha = Buffer.from(stdout);
2222
return to.set(sha, sha.length);
2323
})
2424
.then(() => Error.CODE.OK);

src/commands/checkout.js

+11-16
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ import {
1313
errorCatchHandler
1414
} from '../helpers';
1515

16-
const isValidLine = str => str !== '';
16+
const isValidLine = (str) => str !== '';
1717

1818
const generateCheckoutStats = (raw) => {
1919
if (raw && typeof raw === 'string') {
@@ -24,31 +24,26 @@ const generateCheckoutStats = (raw) => {
2424

2525
const byteResults = regexResult(statLine, regex.TOTAL_BYTES);
2626

27-
stats.total_bytes_checked_out =
28-
byteResults !== null ?
29-
byteResults[0].trim() : BAD_REGEX_PARSE_RESULT;
27+
stats.total_bytes_checked_out = byteResults !== null
28+
? byteResults[0].trim() : BAD_REGEX_PARSE_RESULT;
3029

31-
stats.total_bytes =
32-
byteResults !== null ?
33-
byteResults[1].trim() : BAD_REGEX_PARSE_RESULT;
30+
stats.total_bytes = byteResults !== null
31+
? byteResults[1].trim() : BAD_REGEX_PARSE_RESULT;
3432

3533
const fileResults = regexResult(statLine, regex.TOTAL_FILES);
3634

37-
stats.total_files_checked_out =
38-
fileResults !== null ?
39-
fileResults[0].trim() : BAD_REGEX_PARSE_RESULT;
35+
stats.total_files_checked_out = fileResults !== null
36+
? fileResults[0].trim() : BAD_REGEX_PARSE_RESULT;
4037

4138
const skippedByteResults = regexResult(statLine, regex.SKIPPED_BYTES);
4239

43-
stats.total_bytes_skipped =
44-
skippedByteResults !== null ?
45-
skippedByteResults[0].trim() : BAD_REGEX_PARSE_RESULT;
40+
stats.total_bytes_skipped = skippedByteResults !== null
41+
? skippedByteResults[0].trim() : BAD_REGEX_PARSE_RESULT;
4642

4743
const skippedFileResults = regexResult(statLine, regex.SKIPPED_FILES);
4844

49-
stats.total_files_skipped =
50-
skippedFileResults !== null ?
51-
skippedFileResults[0].trim() : BAD_REGEX_PARSE_RESULT;
45+
stats.total_files_skipped = skippedFileResults !== null
46+
? skippedFileResults[0].trim() : BAD_REGEX_PARSE_RESULT;
5247

5348
verifyOutput(stats, raw);
5449

src/commands/clone.js

+13-17
Original file line numberDiff line numberDiff line change
@@ -8,9 +8,10 @@ import generateResponse from '../utils/generateResponse';
88
import {
99
regexResult,
1010
errorCatchHandler,
11-
verifyOutput } from '../helpers';
11+
verifyOutput
12+
} from '../helpers';
1213

13-
const isValidLine = str => str !== '';
14+
const isValidLine = (str) => str !== '';
1415

1516
const generateCloneStats = (raw) => {
1617
if (raw && typeof raw === 'string') {
@@ -21,31 +22,26 @@ const generateCloneStats = (raw) => {
2122

2223
const byteResults = regexResult(statLine, regex.TOTAL_BYTES);
2324

24-
stats.total_bytes_cloned =
25-
byteResults !== null ?
26-
byteResults[0].trim() : BAD_REGEX_PARSE_RESULT;
25+
stats.total_bytes_cloned = byteResults !== null
26+
? byteResults[0].trim() : BAD_REGEX_PARSE_RESULT;
2727

28-
stats.total_bytes =
29-
byteResults !== null ?
30-
byteResults[1].trim() : BAD_REGEX_PARSE_RESULT;
28+
stats.total_bytes = byteResults !== null
29+
? byteResults[1].trim() : BAD_REGEX_PARSE_RESULT;
3130

3231
const fileResults = regexResult(statLine, regex.TOTAL_FILES);
3332

34-
stats.total_files_cloned =
35-
fileResults !== null ?
36-
fileResults[0].trim() : BAD_REGEX_PARSE_RESULT;
33+
stats.total_files_cloned = fileResults !== null
34+
? fileResults[0].trim() : BAD_REGEX_PARSE_RESULT;
3735

3836
const skippedByteResults = regexResult(statLine, regex.SKIPPED_BYTES);
3937

40-
stats.total_bytes_skipped =
41-
skippedByteResults !== null ?
42-
skippedByteResults[0].trim() : BAD_REGEX_PARSE_RESULT;
38+
stats.total_bytes_skipped = skippedByteResults !== null
39+
? skippedByteResults[0].trim() : BAD_REGEX_PARSE_RESULT;
4340

4441
const skippedFileResults = regexResult(statLine, regex.SKIPPED_FILES);
4542

46-
stats.total_files_skipped =
47-
skippedFileResults !== null ?
48-
skippedFileResults[0].trim() : BAD_REGEX_PARSE_RESULT;
43+
stats.total_files_skipped = skippedFileResults !== null
44+
? skippedFileResults[0].trim() : BAD_REGEX_PARSE_RESULT;
4945

5046
verifyOutput(stats, raw);
5147

src/commands/fetch.js

+13-17
Original file line numberDiff line numberDiff line change
@@ -9,9 +9,10 @@ import generateResponse from '../utils/generateResponse';
99
import {
1010
regexResult,
1111
errorCatchHandler,
12-
verifyOutput } from '../helpers';
12+
verifyOutput
13+
} from '../helpers';
1314

14-
const isValidLine = str => str !== '';
15+
const isValidLine = (str) => str !== '';
1516

1617
const generateFetchStats = (raw) => {
1718
if (raw && typeof raw === 'string') {
@@ -22,31 +23,26 @@ const generateFetchStats = (raw) => {
2223

2324
const byteResults = regexResult(statLine, regex.TOTAL_BYTES);
2425

25-
stats.total_bytes_fetched =
26-
byteResults !== null ?
27-
byteResults[0].trim() : BAD_REGEX_PARSE_RESULT;
26+
stats.total_bytes_fetched = byteResults !== null
27+
? byteResults[0].trim() : BAD_REGEX_PARSE_RESULT;
2828

29-
stats.total_bytes =
30-
byteResults !== null ?
31-
byteResults[1].trim() : BAD_REGEX_PARSE_RESULT;
29+
stats.total_bytes = byteResults !== null
30+
? byteResults[1].trim() : BAD_REGEX_PARSE_RESULT;
3231

3332
const fileResults = regexResult(statLine, regex.TOTAL_FILES);
3433

35-
stats.total_files_fetched =
36-
fileResults !== null ?
37-
fileResults[0].trim() : BAD_REGEX_PARSE_RESULT;
34+
stats.total_files_fetched = fileResults !== null
35+
? fileResults[0].trim() : BAD_REGEX_PARSE_RESULT;
3836

3937
const skippedByteResults = regexResult(statLine, regex.SKIPPED_BYTES);
4038

41-
stats.total_bytes_skipped =
42-
skippedByteResults !== null ?
43-
skippedByteResults[0].trim() : BAD_REGEX_PARSE_RESULT;
39+
stats.total_bytes_skipped = skippedByteResults !== null
40+
? skippedByteResults[0].trim() : BAD_REGEX_PARSE_RESULT;
4441

4542
const skippedFileResults = regexResult(statLine, regex.SKIPPED_FILES);
4643

47-
stats.total_files_skipped =
48-
skippedFileResults !== null ?
49-
skippedFileResults[0].trim() : BAD_REGEX_PARSE_RESULT;
44+
stats.total_files_skipped = skippedFileResults !== null
45+
? skippedFileResults[0].trim() : BAD_REGEX_PARSE_RESULT;
5046

5147
verifyOutput(stats, raw);
5248

src/commands/lfsCommands.js

+2-2
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ export const core = {
55
checkout: (args = '', options, repoPath, callback) => spawn(`git lfs checkout ${args}`, null, options, callback, repoPath),
66
clone: (args = '', options, repoUrl, callback) => spawn(`git lfs clone ${args}`, null, options, callback, repoUrl),
77
fetch: (args = '', options, repoPath, callback) => spawn(`git lfs fetch ${args}`, null, options, callback, repoPath),
8-
fsck: options => exec('git lfs fsck', null, options),
8+
fsck: (options) => exec('git lfs fsck', null, options),
99
git: (args = '', options) => exec(`git ${args}`, null, options),
1010
install: (args = '', options) => exec(`git lfs install ${args}`, null, options),
1111
logs: (args = '', options) => exec(`git lfs logs ${args}`, null, options),
@@ -18,5 +18,5 @@ export const core = {
1818
track: (args = '', options) => exec(`git lfs track ${args}`, null, options),
1919
untrack: (args = '', options) => exec(`git lfs untrack ${args}`, null, options),
2020
update: (args = '', options) => exec(`git lfs update ${args}`, null, options),
21-
version: options => exec('git lfs version', null, options),
21+
version: (options) => exec('git lfs version', null, options),
2222
};

src/commands/ls.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ import {
55
} from '../constants';
66
import generateResponse from '../utils/generateResponse';
77

8-
const isValidFileOutput = str => str.includes('*') || str.includes('-');
8+
const isValidFileOutput = (str) => str.includes('*') || str.includes('-');
99

1010
const reduceResults = (acc, value) => {
1111
const separatorRegex = /[*-]/;

src/commands/pull.js

+13-17
Original file line numberDiff line numberDiff line change
@@ -9,9 +9,10 @@ import generateResponse from '../utils/generateResponse';
99
import {
1010
regexResult,
1111
verifyOutput,
12-
errorCatchHandler } from '../helpers';
12+
errorCatchHandler
13+
} from '../helpers';
1314

14-
const isValidLine = str => str !== '';
15+
const isValidLine = (str) => str !== '';
1516

1617
const generatePullStats = (raw) => {
1718
if (raw && typeof raw === 'string') {
@@ -22,31 +23,26 @@ const generatePullStats = (raw) => {
2223

2324
const byteResults = regexResult(statLine, regex.TOTAL_BYTES);
2425

25-
stats.total_bytes_pulled =
26-
byteResults !== null ?
27-
byteResults[0].trim() : BAD_REGEX_PARSE_RESULT;
26+
stats.total_bytes_pulled = byteResults !== null
27+
? byteResults[0].trim() : BAD_REGEX_PARSE_RESULT;
2828

29-
stats.total_bytes =
30-
byteResults !== null ?
31-
byteResults[1].trim() : BAD_REGEX_PARSE_RESULT;
29+
stats.total_bytes = byteResults !== null
30+
? byteResults[1].trim() : BAD_REGEX_PARSE_RESULT;
3231

3332
const fileResults = regexResult(statLine, regex.TOTAL_FILES);
3433

35-
stats.total_files_pulled =
36-
fileResults !== null ?
37-
fileResults[0].trim() : BAD_REGEX_PARSE_RESULT;
34+
stats.total_files_pulled = fileResults !== null
35+
? fileResults[0].trim() : BAD_REGEX_PARSE_RESULT;
3836

3937
const skippedByteResults = regexResult(statLine, regex.SKIPPED_BYTES);
4038

41-
stats.total_bytes_skipped =
42-
skippedByteResults !== null ?
43-
skippedByteResults[0].trim() : BAD_REGEX_PARSE_RESULT;
39+
stats.total_bytes_skipped = skippedByteResults !== null
40+
? skippedByteResults[0].trim() : BAD_REGEX_PARSE_RESULT;
4441

4542
const skippedFileResults = regexResult(statLine, regex.SKIPPED_FILES);
4643

47-
stats.total_files_skipped =
48-
skippedFileResults !== null ?
49-
skippedFileResults[0].trim() : BAD_REGEX_PARSE_RESULT;
44+
stats.total_files_skipped = skippedFileResults !== null
45+
? skippedFileResults[0].trim() : BAD_REGEX_PARSE_RESULT;
5046

5147
verifyOutput(stats, raw);
5248

src/commands/push.js

+4-3
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,8 @@ import generateResponse from '../utils/generateResponse';
88
import {
99
regexResult,
1010
errorCatchHandler,
11-
verifyOutput } from '../helpers';
11+
verifyOutput
12+
} from '../helpers';
1213

1314
/**
1415
* Note to future maintainers, I do not like this; at all. But at the moment this is the
@@ -17,7 +18,7 @@ import {
1718
* git core dependency, we will have to regex the output. Godspeed.
1819
*/
1920

20-
const isValidLine = str => str !== '';
21+
const isValidLine = (str) => str !== '';
2122

2223
const generatePushStats = (raw) => {
2324
if (!raw || typeof raw !== 'string') {
@@ -93,7 +94,7 @@ function push(repo, options) {
9394
return Promise.all(promises);
9495
})
9596
.then((results) => {
96-
remoteRef = results[0];
97+
([remoteRef] = results);
9798
branch = branch || results[1];
9899
return this.NodeGit.Branch.remoteName(repo, remoteRef.name());
99100
})

src/commands/track.js

+2-2
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ import {
66
BAD_CORE_RESPONSE,
77
} from '../constants';
88

9-
const isString = str => typeof str === 'string';
9+
const isString = (str) => typeof str === 'string';
1010
const ticks = process.platform === 'win32' ? '"' : "'";
1111

1212
const extractGlobs = (input, regex) => {
@@ -20,7 +20,7 @@ const track = (repo, globs) => {
2020

2121
const filteredGlobs = R.pipe(
2222
R.filter(isString),
23-
R.map(g => `${ticks}${g}${ticks}`)
23+
R.map((g) => `${ticks}${g}${ticks}`)
2424
)(globs);
2525
const response = generateResponse();
2626
const repoPath = repo.workdir();

0 commit comments

Comments
 (0)