8000 Upgrade dependencies and fix ESLint issues. · Nemutagk/javascript-algorithms@63f5a27 · GitHub
[go: up one dir, main page]

Skip to content

Commit 63f5a27

Browse files
committed
Upgrade dependencies and fix ESLint issues.
1 parent 4d8baf8 commit 63f5a27

File tree

36 files changed

+6154
-3342
lines changed

36 files changed

+6154
-3342
lines changed

package-lock.json

Lines changed: 6103 additions & 3288 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -35,15 +35,15 @@
3535
"devDependencies": {
3636
"@babel/cli": "^7.10.5",
3737
"@babel/preset-env": "^7.10.4",
38-
"@types/jest": "^24.9.1",
39-
"eslint": "^6.8.0",
40-
"eslint-config-airbnb": "^17.1.1",
38+
"@types/jest": "^26.0.7",
39+
"eslint": "^7.5.0",
40+
"eslint-config-airbnb": "^18.2.0",
4141
"eslint-plugin-import": "^2.22.0",
42-
"eslint-plugin-jest": "^22.21.0",
42+
"eslint-plugin-jest": "^23.18.2",
4343
"eslint-plugin-jsx-a11y": "^6.3.1",
4444
"eslint-plugin-react": "^7.20.3",
45-
"husky": "^2.7.0",
46-
"jest": "^24.9.0"
45+
"husky": "^4.2.5",
46+
"jest": "^26.1.0"
4747
},
4848
"dependencies": {}
4949
}

src/algorithms/cryptography/polynomial-hash/PolynomialHash.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ export default class PolynomialHash {
2020
* @return {number}
2121
*/
2222
hash(word) {
23-
const charCodes = Array.from(word).map(char => this.charToNumber(char));
23+
const charCodes = Array.from(word).map((char) => this.charToNumber(char));
2424

2525
let hash = 0;
2626
for (let charIndex = 0; charIndex < charCodes.length; charIndex += 1) {

src/algorithms/graph/articulation-points/articulationPoints.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,7 @@ export default function articulationPoints(graph) {
6666
// Get minimum low discovery time from all neighbors.
6767
/** @param {GraphVertex} neighbor */
6868
visitedSet[currentVertex.getKey()].lowDiscoveryTime = currentVertex.getNeighbors()
69-
.filter(earlyNeighbor => earlyNeighbor.getKey() !== previousVertex.getKey())
69+
.filter((earlyNeighbor) => earlyNeighbor.getKey() !== previousVertex.getKey())
7070
/**
7171
* @param {number} lowestDiscoveryTime
7272
* @param {GraphVertex} neighbor

src/algorithms/graph/bridges/graphBridges.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ export default function graphBridges(graph) {
5353

5454
// Check if current node is connected to any early node other then previous one.
5555
visitedSet[currentVertex.getKey()].lowDiscoveryTime = currentVertex.getNeighbors()
56-
.filter(earlyNeighbor => earlyNeighbor.getKey() !== previousVertex.getKey())
56+
.filter((earlyNeighbor) => earlyNeighbor.getKey() !== previousVertex.getKey())
5757
.reduce(
5858
/**
5959
* @param {number} lowestDiscoveryTime

src/algorithms/graph/detect-cycle/detectUndirectedCycleUsingDisjointSet.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,9 +8,9 @@ import DisjointSet from '../../../data-structures/disjoint-set/DisjointSet';
88
export default function detectUndirectedCycleUsingDisjointSet(graph) {
99
// Create initial singleton disjoint sets for each graph vertex.
1010
/** @param {GraphVertex} graphVertex */
11-
const keyExtractor = graphVertex => graphVertex.getKey();
11+
const keyExtractor = (graphVertex) => graphVertex.getKey();
1212
const disjointSet = new DisjointSet(keyExtractor);
13-
graph.getAllVertices().forEach(graphVertex => disjointSet.makeSet(graphVertex));
13+
graph.getAllVertices().forEach((graphVertex) => disjointSet.makeSet(graphVertex));
1414

1515
// Go trough all graph edges one by one and check if edge vertices are from the
1616
// different sets. In this case joint those sets together. Do this until you find

src/algorithms/graph/eulerian-path/eulerianPath.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,7 @@ export default function eulerianPath(graph) {
7575
[edgeToDelete] = currentEdges;
7676
} else {
7777
// If there are many edges left then we need to peek any of those except bridges.
78-
[edgeToDelete] = currentEdges.filter(edge => !bridges[edge.getKey()]);
78+
[edgeToDelete] = currentEdges.filter((edge) => !bridges[edge.getKey()]);
7979
}
8080

8181
// Detect next current vertex.

src/algorithms/graph/hamiltonian-cycle/hamiltonianCycle.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ function isSafe(adjacencyMatrix, verticesIndices, cycle, vertexCandidate) {
2020
}
2121

2222
// Check if vertexCandidate is being added to the path for the first time.
23-
const candidateDuplicate = cycle.find(vertex => vertex.getKey() === vertexCandidate.getKey());
23+
const candidateDuplicate = cycle.find((vertex) => vertex.getKey() === vertexCandidate.getKey());
2424

2525
return !candidateDuplicate;
2626
}
@@ -61,7 +61,7 @@ function hamiltonianCycleRecursive({
6161
cycle,
6262
}) {
6363
// Clone cycle in order to prevent it from modification by other DFS branches.
64-
const currentCycle = [...cycle].map(vertex => new GraphVertex(vertex.value));
64+
const currentCycle = [...cycle].map((vertex) => new GraphVertex(vertex.value));
6565

6666
if (vertices.length === currentCycle.length) {
6767
// Hamiltonian path is found.

src/algorithms/graph/kruskal/kruskal.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ export default function kruskal(graph) {
3333
const sortedEdges = new QuickSort(sortingCallbacks).sort(graph.getAllEdges());
3434

3535
// Create disjoint sets for all graph vertices.
36-
const keyCallback = graphVertex => graphVertex.getKey();
36+
const keyCallback = (graphVertex) => graphVertex.getKey();
3737
const disjointSet = new DisjointSet(keyCallback);
3838

3939
graph.getAllVertices().forEach((graphVertex) => {

src/algorithms/linked-list/reverse-traversal/__test__/reverseTraversal.test.js

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,6 @@ describe('reverseTraversal', () => {
2121
});
2222
});
2323

24-
2524
// it('should reverse traversal the linked list with callback', () => {
2625
// const linkedList = new LinkedList();
2726
//

0 commit comments

Comments
 (0)
0