@gabrielrufino/cube 2.0.1 → 2.0.3

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.
@@ -0,0 +1 @@
1
+ export type Edge = [string, string];
@@ -0,0 +1,2 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -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(): [string, string][];
14
+ get edges(): Edge[];
14
15
  insert(node: string): string | null;
15
- connect(node1: string, node2: string): [string, 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,6 +1,6 @@
1
1
  {
2
2
  "name": "@gabrielrufino/cube",
3
- "version": "2.0.1",
3
+ "version": "2.0.3",
4
4
  "description": "Data structures made in Typescript",
5
5
  "main": "build/index.js",
6
6
  "scripts": {
@@ -9,8 +9,7 @@
9
9
  "test": "jest",
10
10
  "test:cov": "npm t -- --coverage",
11
11
  "test:mutation": "npx stryker run",
12
- "test:watch": "npm t -- --watch",
13
- "prepare": "husky"
12
+ "test:watch": "npm t -- --watch"
14
13
  },
15
14
  "repository": {
16
15
  "type": "git",