Skip to content

Commit a5ef7d7

Browse files
committed
Merge branch 'master-upstream' into new-major-wrap-up
# Conflicts: # package-lock.json # package.json
2 parents 8c6274d + 07b00b1 commit a5ef7d7

40 files changed

Lines changed: 905 additions & 100 deletions

.github/workflows/main.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ jobs:
2323
uses: bahmutov/npm-install@v1
2424

2525
- name: Check types
26-
run: npm run type-check
26+
run: npm run tsc
2727

2828
- name: Test
2929
run: npm run test

.travis.yml

Lines changed: 0 additions & 3 deletions
This file was deleted.

README.md

Lines changed: 15 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ This library is distributed only via [NPM](npmjs.com). Install by running
2323
Require it in your code like this.
2424

2525
```javascript
26-
const { Graph } = require("graph-data-structure");
26+
const { Graph } = require('graph-data-structure');
2727
```
2828

2929
## Examples
@@ -39,15 +39,15 @@ var graph = Graph();
3939
Add some nodes and edges with **[addNode](#add-node)** and **[addEdge](#add-edge)**.
4040

4141
```javascript
42-
graph.addNode("a");
43-
graph.addNode("b");
44-
graph.addEdge("a", "b");
42+
graph.addNode('a');
43+
graph.addNode('b');
44+
graph.addEdge('a', 'b');
4545
```
4646

4747
Nodes are added implicitly when edges are added.
4848

4949
```javascript
50-
graph.addEdge("b", "c");
50+
graph.addEdge('b', 'c');
5151
```
5252

5353
Now we have the following graph. <img src="https://cloud.githubusercontent.com/assets/68416/15385597/44a10522-1dc0-11e6-9054-2150f851db46.png">
@@ -68,14 +68,14 @@ Here's an example of topological sort with getting dressed (from Cormen et al. "
6868

6969
```javascript
7070
var graph = Graph()
71-
.addEdge("socks", "shoes")
72-
.addEdge("shirt", "belt")
73-
.addEdge("shirt", "tie")
74-
.addEdge("tie", "jacket")
75-
.addEdge("belt", "jacket")
76-
.addEdge("pants", "shoes")
77-
.addEdge("underpants", "pants")
78-
.addEdge("pants", "belt");
71+
.addEdge('socks', 'shoes')
72+
.addEdge('shirt', 'belt')
73+
.addEdge('shirt', 'tie')
74+
.addEdge('tie', 'jacket')
75+
.addEdge('belt', 'jacket')
76+
.addEdge('pants', 'shoes')
77+
.addEdge('underpants', 'pants')
78+
.addEdge('pants', 'belt');
7979

8080
// prints [ "underpants", "pants", "shirt", "tie", "belt", "jacket", "socks", "shoes" ]
8181
console.log(graph.topologicalSort());
@@ -172,8 +172,8 @@ Here's example code for serializing a graph.
172172

173173
```javascript
174174
var graph = Graph();
175-
graph.addEdge("a", "b");
176-
graph.addEdge("b", "c");
175+
graph.addEdge('a', 'b');
176+
graph.addEdge('b', 'c');
177177
var serialized = graph.serialize();
178178
```
179179

package-lock.json

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

package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -39,8 +39,8 @@
3939
"build": "rm -rf dist && rollup -c",
4040
"test": "vitest --run",
4141
"prepublishOnly": "npm run build",
42-
"lint": "prettier --write .",
43-
"type-check": "tsc --noEmit --noEmitOnError",
42+
"prettier": "prettier --write .",
43+
"tsc --noEmit --noEmitOnError": "tsc --noEmit",
4444
"release": "release-it"
4545
},
4646
"devDependencies": {

0 commit comments

Comments
 (0)