@gabrielrufino/cube 2.0.2 → 2.0.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +8 -2
- package/build/Graph/Edge.d.ts +1 -0
- package/build/Graph/Edge.js +2 -0
- package/build/Graph/index.d.ts +5 -4
- package/package.json +7 -11
- package/stryker.config.json +17 -0
package/README.md
CHANGED
|
@@ -1,8 +1,10 @@
|
|
|
1
1
|
# Cube
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
[](https://github.com/gabrielrufino/cube/actions/workflows/ci.yml)
|
|
4
|
+
[](https://github.com/gabrielrufino/cube/actions/workflows/cd.yml)
|
|
5
|
+
[](https://sonarcloud.io/summary/new_code?id=gabrielrufino_cube)
|
|
4
6
|
|
|
5
|
-
|
|
7
|
+
Data structures made in Typescript
|
|
6
8
|
|
|
7
9
|
## Getting started
|
|
8
10
|
|
|
@@ -41,3 +43,7 @@ const cube = require('@gabrielrufino/cube')
|
|
|
41
43
|
* [Min Heap](./docs/MinHeap.md)
|
|
42
44
|
* [Max Heap](./docs/MaxHeap.md)
|
|
43
45
|
* [Graph](./docs/Graph.md)
|
|
46
|
+
|
|
47
|
+
---
|
|
48
|
+
|
|
49
|
+
<small>Black Tech By [Gabriel Rufino](https://github.com/gabrielrufino) 🖤</small>
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export type Edge = [string, string];
|
package/build/Graph/index.d.ts
CHANGED
|
@@ -1,8 +1,9 @@
|
|
|
1
1
|
import IGraph from './IGraph';
|
|
2
2
|
import IGraphOptions from './IGraphOptions';
|
|
3
|
+
import { Edge } from './Edge';
|
|
3
4
|
export default class Graph implements IGraph {
|
|
4
|
-
private _isDirected;
|
|
5
|
-
private _data;
|
|
5
|
+
private readonly _isDirected;
|
|
6
|
+
private readonly _data;
|
|
6
7
|
constructor({ inputs, isDirected }?: Readonly<IGraphOptions>);
|
|
7
8
|
get isDirected(): boolean;
|
|
8
9
|
get data(): {
|
|
@@ -10,9 +11,9 @@ export default class Graph implements IGraph {
|
|
|
10
11
|
};
|
|
11
12
|
get size(): number;
|
|
12
13
|
get nodes(): string[];
|
|
13
|
-
get edges(): [
|
|
14
|
+
get edges(): Edge[];
|
|
14
15
|
insert(node: string): string | null;
|
|
15
|
-
connect(node1: string, node2: string):
|
|
16
|
+
connect(node1: string, node2: string): Edge;
|
|
16
17
|
breadthFirstSearch(startNode: string, callback: (_node: string) => void): void;
|
|
17
18
|
getDistancesFrom(node: string): {
|
|
18
19
|
[key: string]: number;
|
package/package.json
CHANGED
|
@@ -1,15 +1,15 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@gabrielrufino/cube",
|
|
3
|
-
"version": "2.0.
|
|
3
|
+
"version": "2.0.4",
|
|
4
4
|
"description": "Data structures made in Typescript",
|
|
5
5
|
"main": "build/index.js",
|
|
6
6
|
"scripts": {
|
|
7
7
|
"build": "tsc",
|
|
8
8
|
"lint": "eslint src/**/*.ts",
|
|
9
|
-
"test": "
|
|
9
|
+
"test": "vitest run",
|
|
10
10
|
"test:cov": "npm t -- --coverage",
|
|
11
11
|
"test:mutation": "npx stryker run",
|
|
12
|
-
"test:watch": "
|
|
12
|
+
"test:watch": "vitest"
|
|
13
13
|
},
|
|
14
14
|
"repository": {
|
|
15
15
|
"type": "git",
|
|
@@ -30,18 +30,14 @@
|
|
|
30
30
|
"@commitlint/cli": "^19.5.0",
|
|
31
31
|
"@commitlint/config-conventional": "^19.5.0",
|
|
32
32
|
"@faker-js/faker": "^8.4.1",
|
|
33
|
-
"@stryker-mutator/
|
|
34
|
-
"@stryker-mutator/jest-runner": "^8.6.0",
|
|
35
|
-
"@stryker-mutator/typescript-checker": "^8.6.0",
|
|
36
|
-
"@types/jest": "^28.1.8",
|
|
33
|
+
"@stryker-mutator/vitest-runner": "^8.7.1",
|
|
37
34
|
"@typescript-eslint/eslint-plugin": "^5.62.0",
|
|
38
35
|
"@typescript-eslint/parser": "^5.62.0",
|
|
36
|
+
"@vitest/coverage-v8": "^2.1.8",
|
|
39
37
|
"eslint": "^8.57.1",
|
|
40
38
|
"eslint-config-xo": "^0.43.1",
|
|
41
39
|
"husky": "^9.1.6",
|
|
42
|
-
"
|
|
43
|
-
"
|
|
44
|
-
"ts-node": "^10.9.2",
|
|
45
|
-
"typescript": "^5.6.3"
|
|
40
|
+
"typescript": "^5.6.3",
|
|
41
|
+
"vitest": "^2.1.8"
|
|
46
42
|
}
|
|
47
43
|
}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
{
|
|
2
|
+
"$schema": "./node_modules/@stryker-mutator/core/schema/stryker-schema.json",
|
|
3
|
+
"_comment": "This config was generated using 'stryker init'. Please take a look at: https://stryker-mutator.io/docs/stryker-js/configuration/ for more information.",
|
|
4
|
+
"packageManager": "npm",
|
|
5
|
+
"reporters": [
|
|
6
|
+
"html",
|
|
7
|
+
"clear-text",
|
|
8
|
+
"progress"
|
|
9
|
+
],
|
|
10
|
+
"testRunner": "vitest",
|
|
11
|
+
"testRunner_comment": "Take a look at https://stryker-mutator.io/docs/stryker-js/vitest-runner for information about the vitest plugin.",
|
|
12
|
+
"coverageAnalysis": "perTest",
|
|
13
|
+
"buildCommand": "npm run build",
|
|
14
|
+
"htmlReporter": {
|
|
15
|
+
"baseDir": ".stryker-reports"
|
|
16
|
+
}
|
|
17
|
+
}
|