From 7db92b09a7567bd6f8bbad9aa03e6ab86b882b86 Mon Sep 17 00:00:00 2001 From: Erik Date: Wed, 18 Oct 2023 23:40:48 +0200 Subject: [PATCH 1/8] Renamed testing file --- .github/workflows/{node.js.yml => testing.yml} | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename .github/workflows/{node.js.yml => testing.yml} (100%) diff --git a/.github/workflows/node.js.yml b/.github/workflows/testing.yml similarity index 100% rename from .github/workflows/node.js.yml rename to .github/workflows/testing.yml From 3412852b8ecaeb4d8ebfca6a7ac7aa4a6754f92b Mon Sep 17 00:00:00 2001 From: Erik Date: Sat, 21 Oct 2023 12:43:28 +0200 Subject: [PATCH 2/8] Added debbuging settings. --- launch.json | 15 +++++++++++++++ 1 file changed, 15 insertions(+) create mode 100644 launch.json diff --git a/launch.json b/launch.json new file mode 100644 index 0000000..3585f95 --- /dev/null +++ b/launch.json @@ -0,0 +1,15 @@ +{ + "version": "0.2.0", + "configurations": [ + { + "type": "node", + "request": "launch", + "name": "Debug TypeScript", + "program": "${workspaceFolder}/path/to/your/app.ts", + "preLaunchTask": "tsc: build - tsconfig.json", + "outFiles": ["${workspaceFolder}/dist/**/*.js"], + "sourceMaps": true, + "protocol": "inspector" + } + ] +} From 276026589ad2a91883834a1254af4c34850a5b1d Mon Sep 17 00:00:00 2001 From: Erik Date: Sat, 21 Oct 2023 13:12:58 +0200 Subject: [PATCH 3/8] Updated Graph, Group, Pq with more error messages and updated tests. --- Class/Graph.ts | 2 +- Class/Groups.ts | 2 +- Class/PriorityQueue.ts | 16 ++++------------ test/Groups.test.ts | 8 ++++---- test/pq.test.ts | 10 ++++------ 5 files changed, 14 insertions(+), 24 deletions(-) diff --git a/Class/Graph.ts b/Class/Graph.ts index 8812f46..183488e 100644 --- a/Class/Graph.ts +++ b/Class/Graph.ts @@ -35,7 +35,7 @@ class DirectedGraph { includes(item: T): boolean { return this.nodes.some((node) => node.value === item); } - getNode(value: T): GraphNode | undefined { + getNode(value: T): GraphNode { return this.nodes.find((node) => node.value === value); } removeEdge(from: GraphNode, to: GraphNode): void { diff --git a/Class/Groups.ts b/Class/Groups.ts index 1d557fd..44f1dc9 100644 --- a/Class/Groups.ts +++ b/Class/Groups.ts @@ -31,7 +31,7 @@ class Groups { return this.groups; } - get(path: string[]): Group | undefined { + get(path: string[]): Group { return this.groups.find((group) => arraysHaveSameValues(group.path, path)); } } diff --git a/Class/PriorityQueue.ts b/Class/PriorityQueue.ts index 94d4f14..6472847 100644 --- a/Class/PriorityQueue.ts +++ b/Class/PriorityQueue.ts @@ -9,9 +9,9 @@ class PriorityQueue { this.heapifyUp(); } - dequeue(): T | undefined { + dequeue(): T { if (this.isEmpty()) { - return undefined; + throw new Error("PriorityQueue is Empty. Can't dequeue."); } const ROOT = this.items[0]; @@ -26,24 +26,16 @@ class PriorityQueue { return ROOT.element; } - peek(): T | undefined { + front(): T | undefined { return this.isEmpty() ? undefined : this.items[0].element; } - peekLast(): T | undefined { + rear(): T | undefined { return this.isEmpty() ? undefined : this.items[this.items.length - 1].element; } - front(): T | undefined { - return this.peek(); - } - - rear(): T | undefined { - return this.peekLast(); - } - isEmpty(): boolean { return this.items.length === 0; } diff --git a/test/Groups.test.ts b/test/Groups.test.ts index e990ff0..d8e729d 100644 --- a/test/Groups.test.ts +++ b/test/Groups.test.ts @@ -7,7 +7,7 @@ describe("Groups class", () => { groups = new Groups(); }); - test("should add a student to an existing group", () => { + it("should add a student to an existing group", () => { const path = ["A", "B", "C"]; const studentId = "123"; @@ -17,7 +17,7 @@ describe("Groups class", () => { expect(groups.getAll()).toEqual([expectedGroup]); }); - test("should create a new group if path doesn't exist", () => { + it("should create a new group if path doesn't exist", () => { const path1 = ["A", "B", "C"]; const path2 = ["X", "Y", "Z"]; const studentId1 = "123"; @@ -33,7 +33,7 @@ describe("Groups class", () => { expect(groups.getAll()).toEqual(expectedGroups); }); - test("should get a group by path", () => { + it("should get a group by path", () => { const path = ["A", "B", "C"]; const studentId = "123"; @@ -45,7 +45,7 @@ describe("Groups class", () => { expect(retrievedGroup).toEqual(expectedGroup); }); - test("should return undefined when getting a non-existing group", () => { + it("should return undefined when getting a non-existing group", () => { const path = ["X", "Y", "Z"]; const retrievedGroup = groups.get(path); diff --git a/test/pq.test.ts b/test/pq.test.ts index 749b0fb..a7aa32d 100644 --- a/test/pq.test.ts +++ b/test/pq.test.ts @@ -13,12 +13,10 @@ describe("PriorityQueue", () => { expect(priorityQueue.dequeue()).toBe("Task 1"); }); - it("should return undefined when dequeuing from an empty queue", () => { + it("should return when dequeuing from an empty queue", () => { const priorityQueue = new PriorityQueue(); - const result = priorityQueue.dequeue(); - - expect(result).toBeUndefined(); + expect(() => priorityQueue.dequeue()).toThrow(); }); it("should return the front element without dequeuing", () => { @@ -51,8 +49,8 @@ describe("PriorityQueue", () => { it("should return undefined when peeking an empty queue", () => { const priorityQueue = new PriorityQueue(); - expect(priorityQueue.peek()).toBeUndefined(); - expect(priorityQueue.peekLast()).toBeUndefined(); + expect(priorityQueue.front()).toBeUndefined(); + expect(priorityQueue.rear()).toBeUndefined(); }); it("should return the correct size of the queue", () => { From 914f0083d05c1e3c816979354a0e494d3446f4fd Mon Sep 17 00:00:00 2001 From: Erik Date: Sat, 21 Oct 2023 13:14:10 +0200 Subject: [PATCH 4/8] Created tests for utils/array. --- test/utils/array.test.ts | 33 +++++++++++++++++++++++++++++++++ 1 file changed, 33 insertions(+) create mode 100644 test/utils/array.test.ts diff --git a/test/utils/array.test.ts b/test/utils/array.test.ts new file mode 100644 index 0000000..21e5a1c --- /dev/null +++ b/test/utils/array.test.ts @@ -0,0 +1,33 @@ +import { arraysHaveSameValues } from "../../utils/array"; + +describe("arraysHaveSameValues", () => { + it("should return true for arrays with the same values", () => { + const arr1 = [1, 2, 3]; + const arr2 = [3, 2, 1]; + expect(arraysHaveSameValues(arr1, arr2)).toBe(true); + }); + + it("should return false for arrays with different lengths", () => { + const arr1 = [1, 2, 2]; + const arr2 = [1, 2, 3, 4]; + expect(arraysHaveSameValues(arr1, arr2)).toBe(false); + }); + + it("should return false for arrays with different values", () => { + const arr1 = [1, 2, 3]; + const arr2 = [4, 5, 6]; + expect(arraysHaveSameValues(arr1, arr2)).toBe(false); + }); + + it("should return true for empty arrays", () => { + const arr1: number[] = []; + const arr2: number[] = []; + expect(arraysHaveSameValues(arr1, arr2)).toBe(true); + }); + + it("should return true for arrays with duplicate values", () => { + const arr1 = [1, 2, 2, 3, 4]; + const arr2 = [3, 2, 1, 4, 2]; + expect(arraysHaveSameValues(arr1, arr2)).toBe(true); + }); +}); From 38c4cdc7f39ac1b9f56e86a85098e668ef166108 Mon Sep 17 00:00:00 2001 From: Erik Date: Sat, 21 Oct 2023 13:27:01 +0200 Subject: [PATCH 5/8] Added for verified commits. --- settings.json | 1 + 1 file changed, 1 insertion(+) create mode 100644 settings.json diff --git a/settings.json b/settings.json new file mode 100644 index 0000000..5f2f9b0 --- /dev/null +++ b/settings.json @@ -0,0 +1 @@ +{ "git.enableCommitSigning": true } From 42e6dea12ef638a734f62533890e1f8ebb7871dc Mon Sep 17 00:00:00 2001 From: Erik Date: Sun, 22 Oct 2023 14:18:08 +0200 Subject: [PATCH 6/8] Added eslint and restructured settings. --- .eslintignore | 10 + .eslintrc | 0 launch.json => .vscode/launch.json | 0 jest.config.js | 11 +- package-lock.json | 796 +++++++++++++++++++++++++++++ package.json | 1 + settings.json | 1 - tsconfig.json | 2 +- 8 files changed, 818 insertions(+), 3 deletions(-) create mode 100644 .eslintignore create mode 100644 .eslintrc rename launch.json => .vscode/launch.json (100%) delete mode 100644 settings.json diff --git a/.eslintignore b/.eslintignore new file mode 100644 index 0000000..0dbcb08 --- /dev/null +++ b/.eslintignore @@ -0,0 +1,10 @@ +# /node_modules/* in the project root is ignored by default +# build artefacts +dist/* +coverage/* +# data definition files +**/*.d.ts +# 3rd party libs +/src/public/ +# custom definition files +/src/types/ \ No newline at end of file diff --git a/.eslintrc b/.eslintrc new file mode 100644 index 0000000..e69de29 diff --git a/launch.json b/.vscode/launch.json similarity index 100% rename from launch.json rename to .vscode/launch.json diff --git a/jest.config.js b/jest.config.js index a93551f..8179384 100644 --- a/jest.config.js +++ b/jest.config.js @@ -1,4 +1,13 @@ module.exports = { - preset: "ts-jest", + globals: { + "ts-jest": { + tsconfig: "tsconfig.json", + }, + }, + moduleFileExtensions: ["ts", "js"], + transform: { + "^.+\\.(ts|tsx)$": "ts-jest", + }, + testMatch: ["**/test/**/*.test.(ts|js)"], testEnvironment: "node", }; diff --git a/package-lock.json b/package-lock.json index e49bab1..be6750e 100644 --- a/package-lock.json +++ b/package-lock.json @@ -11,11 +11,21 @@ "devDependencies": { "@types/jest": "^29.5.5", "@types/node": "^20.6.5", + "eslint": "^8.52.0", "jest": "^29.7.0", "ts-jest": "^29.1.1", "typescript": "^5.2.2" } }, + "node_modules/@aashutoshrathi/word-wrap": { + "version": "1.2.6", + "resolved": "https://registry.npmjs.org/@aashutoshrathi/word-wrap/-/word-wrap-1.2.6.tgz", + "integrity": "sha512-1Yjs2SvM8TflER/OD3cOjhWWOZb58A2t7wpE2S9XfBYTiIl+XFhQG2bjy4Pu1I+EAlCNUzRDYDdFwFYUKvXcIA==", + "dev": true, + "engines": { + "node": ">=0.10.0" + } + }, "node_modules/@ampproject/remapping": { "version": "2.2.1", "resolved": "https://registry.npmjs.org/@ampproject/remapping/-/remapping-2.2.1.tgz", @@ -678,6 +688,140 @@ "node": ">=12" } }, + "node_modules/@eslint-community/eslint-utils": { + "version": "4.4.0", + "resolved": "https://registry.npmjs.org/@eslint-community/eslint-utils/-/eslint-utils-4.4.0.tgz", + "integrity": "sha512-1/sA4dwrzBAyeUoQ6oxahHKmrZvsnLCg4RfxW3ZFGGmQkSNQPFNLV9CUEFQP1x9EYXHTo5p6xdhZM1Ne9p/AfA==", + "dev": true, + "dependencies": { + "eslint-visitor-keys": "^3.3.0" + }, + "engines": { + "node": "^12.22.0 || ^14.17.0 || >=16.0.0" + }, + "peerDependencies": { + "eslint": "^6.0.0 || ^7.0.0 || >=8.0.0" + } + }, + "node_modules/@eslint-community/regexpp": { + "version": "4.9.1", + "resolved": "https://registry.npmjs.org/@eslint-community/regexpp/-/regexpp-4.9.1.tgz", + "integrity": "sha512-Y27x+MBLjXa+0JWDhykM3+JE+il3kHKAEqabfEWq3SDhZjLYb6/BHL/JKFnH3fe207JaXkyDo685Oc2Glt6ifA==", + "dev": true, + "engines": { + "node": "^12.0.0 || ^14.0.0 || >=16.0.0" + } + }, + "node_modules/@eslint/eslintrc": { + "version": "2.1.2", + "resolved": "https://registry.npmjs.org/@eslint/eslintrc/-/eslintrc-2.1.2.tgz", + "integrity": "sha512-+wvgpDsrB1YqAMdEUCcnTlpfVBH7Vqn6A/NT3D8WVXFIaKMlErPIZT3oCIAVCOtarRpMtelZLqJeU3t7WY6X6g==", + "dev": true, + "dependencies": { + "ajv": "^6.12.4", + "debug": "^4.3.2", + "espree": "^9.6.0", + "globals": "^13.19.0", + "ignore": "^5.2.0", + "import-fresh": "^3.2.1", + "js-yaml": "^4.1.0", + "minimatch": "^3.1.2", + "strip-json-comments": "^3.1.1" + }, + "engines": { + "node": "^12.22.0 || ^14.17.0 || >=16.0.0" + }, + "funding": { + "url": "https://opencollective.com/eslint" + } + }, + "node_modules/@eslint/eslintrc/node_modules/argparse": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/argparse/-/argparse-2.0.1.tgz", + "integrity": "sha512-8+9WqebbFzpX9OR+Wa6O29asIogeRMzcGtAINdpMHHyAg10f05aSFVBbcEqGf/PXw1EjAZ+q2/bEBg3DvurK3Q==", + "dev": true + }, + "node_modules/@eslint/eslintrc/node_modules/globals": { + "version": "13.23.0", + "resolved": "https://registry.npmjs.org/globals/-/globals-13.23.0.tgz", + "integrity": "sha512-XAmF0RjlrjY23MA51q3HltdlGxUpXPvg0GioKiD9X6HD28iMjo2dKC8Vqwm7lne4GNr78+RHTfliktR6ZH09wA==", + "dev": true, + "dependencies": { + "type-fest": "^0.20.2" + }, + "engines": { + "node": ">=8" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/@eslint/eslintrc/node_modules/js-yaml": { + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/js-yaml/-/js-yaml-4.1.0.tgz", + "integrity": "sha512-wpxZs9NoxZaJESJGIZTyDEaYpl0FKSA+FB9aJiyemKhMwkxQg63h4T1KJgUGHpTqPDNRcmmYLugrRjJlBtWvRA==", + "dev": true, + "dependencies": { + "argparse": "^2.0.1" + }, + "bin": { + "js-yaml": "bin/js-yaml.js" + } + }, + "node_modules/@eslint/eslintrc/node_modules/type-fest": { + "version": "0.20.2", + "resolved": "https://registry.npmjs.org/type-fest/-/type-fest-0.20.2.tgz", + "integrity": "sha512-Ne+eE4r0/iWnpAxD852z3A+N0Bt5RN//NjJwRd2VFHEmrywxf5vsZlh4R6lixl6B+wz/8d+maTSAkN1FIkI3LQ==", + "dev": true, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/@eslint/js": { + "version": "8.52.0", + "resolved": "https://registry.npmjs.org/@eslint/js/-/js-8.52.0.tgz", + "integrity": "sha512-mjZVbpaeMZludF2fsWLD0Z9gCref1Tk4i9+wddjRvpUNqqcndPkBD09N/Mapey0b3jaXbLm2kICwFv2E64QinA==", + "dev": true, + "engines": { + "node": "^12.22.0 || ^14.17.0 || >=16.0.0" + } + }, + "node_modules/@humanwhocodes/config-array": { + "version": "0.11.13", + "resolved": "https://registry.npmjs.org/@humanwhocodes/config-array/-/config-array-0.11.13.tgz", + "integrity": "sha512-JSBDMiDKSzQVngfRjOdFXgFfklaXI4K9nLF49Auh21lmBWRLIK3+xTErTWD4KU54pb6coM6ESE7Awz/FNU3zgQ==", + "dev": true, + "dependencies": { + "@humanwhocodes/object-schema": "^2.0.1", + "debug": "^4.1.1", + "minimatch": "^3.0.5" + }, + "engines": { + "node": ">=10.10.0" + } + }, + "node_modules/@humanwhocodes/module-importer": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/@humanwhocodes/module-importer/-/module-importer-1.0.1.tgz", + "integrity": "sha512-bxveV4V8v5Yb4ncFTT3rPSgZBOpCkjfK0y4oVVVJwIuDVBRMDXrPyXRL988i5ap9m9bnyEEjWfm5WkBmtffLfA==", + "dev": true, + "engines": { + "node": ">=12.22" + }, + "funding": { + "type": "github", + "url": "https://github.com/sponsors/nzakas" + } + }, + "node_modules/@humanwhocodes/object-schema": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/@humanwhocodes/object-schema/-/object-schema-2.0.1.tgz", + "integrity": "sha512-dvuCeX5fC9dXgJn9t+X5atfmgQAzUOWqS1254Gh0m6i8wKd10ebXkfNKiRK+1GWi/yTvvLDHpoxLr0xxxeslWw==", + "dev": true + }, "node_modules/@istanbuljs/load-nyc-config": { "version": "1.1.0", "resolved": "https://registry.npmjs.org/@istanbuljs/load-nyc-config/-/load-nyc-config-1.1.0.tgz", @@ -1056,6 +1200,41 @@ "@jridgewell/sourcemap-codec": "^1.4.10" } }, + "node_modules/@nodelib/fs.scandir": { + "version": "2.1.5", + "resolved": "https://registry.npmjs.org/@nodelib/fs.scandir/-/fs.scandir-2.1.5.tgz", + "integrity": "sha512-vq24Bq3ym5HEQm2NKCr3yXDwjc7vTsEThRDnkp2DK9p1uqLR+DHurm/NOTo0KG7HYHU7eppKZj3MyqYuMBf62g==", + "dev": true, + "dependencies": { + "@nodelib/fs.stat": "2.0.5", + "run-parallel": "^1.1.9" + }, + "engines": { + "node": ">= 8" + } + }, + "node_modules/@nodelib/fs.stat": { + "version": "2.0.5", + "resolved": "https://registry.npmjs.org/@nodelib/fs.stat/-/fs.stat-2.0.5.tgz", + "integrity": "sha512-RkhPPp2zrqDAQA/2jNhnztcPAlv64XdhIp7a7454A5ovI7Bukxgt7MX7udwAu3zg1DcpPU0rz3VV1SeaqvY4+A==", + "dev": true, + "engines": { + "node": ">= 8" + } + }, + "node_modules/@nodelib/fs.walk": { + "version": "1.2.8", + "resolved": "https://registry.npmjs.org/@nodelib/fs.walk/-/fs.walk-1.2.8.tgz", + "integrity": "sha512-oGB+UxlgWcgQkgwo8GcEGwemoTFt3FIO9ababBmaGwXIoBKZ+GTy0pP185beGg7Llih/NSHSV2XAs1lnznocSg==", + "dev": true, + "dependencies": { + "@nodelib/fs.scandir": "2.1.5", + "fastq": "^1.6.0" + }, + "engines": { + "node": ">= 8" + } + }, "node_modules/@sinclair/typebox": { "version": "0.27.8", "resolved": "https://registry.npmjs.org/@sinclair/typebox/-/typebox-0.27.8.tgz", @@ -1210,6 +1389,12 @@ "integrity": "sha512-iO9ZQHkZxHn4mSakYV0vFHAVDyEOIJQrV2uZ06HxEPcx+mt8swXoZHIbaaJ2crJYFfErySgktuTZ3BeLz+XmFA==", "dev": true }, + "node_modules/@ungap/structured-clone": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/@ungap/structured-clone/-/structured-clone-1.2.0.tgz", + "integrity": "sha512-zuVdFrMJiuCDQUMCzQaD6KL28MjnqqN8XnAqiEq9PNm/hCPTSGfrXCOfwj1ow4LFb/tNymJPwsNbVePc1xFqrQ==", + "dev": true + }, "node_modules/acorn": { "version": "8.10.0", "resolved": "https://registry.npmjs.org/acorn/-/acorn-8.10.0.tgz", @@ -1221,6 +1406,15 @@ "node": ">=0.4.0" } }, + "node_modules/acorn-jsx": { + "version": "5.3.2", + "resolved": "https://registry.npmjs.org/acorn-jsx/-/acorn-jsx-5.3.2.tgz", + "integrity": "sha512-rq9s+JNhf0IChjtDXxllJ7g41oZk5SlXtp0LHwyA5cejwn7vKmKp4pPri6YEePv2PU65sAsegbXtIinmDFDXgQ==", + "dev": true, + "peerDependencies": { + "acorn": "^6.0.0 || ^7.0.0 || ^8.0.0" + } + }, "node_modules/acorn-walk": { "version": "8.2.0", "resolved": "https://registry.npmjs.org/acorn-walk/-/acorn-walk-8.2.0.tgz", @@ -1229,6 +1423,22 @@ "node": ">=0.4.0" } }, + "node_modules/ajv": { + "version": "6.12.6", + "resolved": "https://registry.npmjs.org/ajv/-/ajv-6.12.6.tgz", + "integrity": "sha512-j3fVLgvTo527anyYyJOGTYJbG+vnnQYvE0m5mmkc1TK+nxAppkCLMIL0aZ4dblVCNoGShhm+kzE4ZUykBoMg4g==", + "dev": true, + "dependencies": { + "fast-deep-equal": "^3.1.1", + "fast-json-stable-stringify": "^2.0.0", + "json-schema-traverse": "^0.4.1", + "uri-js": "^4.2.2" + }, + "funding": { + "type": "github", + "url": "https://github.com/sponsors/epoberezkin" + } + }, "node_modules/ansi-escapes": { "version": "4.3.2", "resolved": "https://registry.npmjs.org/ansi-escapes/-/ansi-escapes-4.3.2.tgz", @@ -1730,6 +1940,12 @@ } } }, + "node_modules/deep-is": { + "version": "0.1.4", + "resolved": "https://registry.npmjs.org/deep-is/-/deep-is-0.1.4.tgz", + "integrity": "sha512-oIPzksmTg4/MriiaYGO+okXDT7ztn/w3Eptv/+gSIdMdKsJo0u4CfYNFJPy+4SKMuCqGw2wxnA+URMg3t8a/bQ==", + "dev": true + }, "node_modules/deepmerge": { "version": "4.3.1", "resolved": "https://registry.npmjs.org/deepmerge/-/deepmerge-4.3.1.tgz", @@ -1773,6 +1989,18 @@ "node": "^14.15.0 || ^16.10.0 || >=18.0.0" } }, + "node_modules/doctrine": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/doctrine/-/doctrine-3.0.0.tgz", + "integrity": "sha512-yS+Q5i3hBf7GBkd4KG8a7eBNNWNGLTaEwwYWUijIYM7zrlYDM0BFXHjjPWlWZ1Rg7UaddZeIDmi9jF3HmqiQ2w==", + "dev": true, + "dependencies": { + "esutils": "^2.0.2" + }, + "engines": { + "node": ">=6.0.0" + } + }, "node_modules/electron-to-chromium": { "version": "1.4.528", "resolved": "https://registry.npmjs.org/electron-to-chromium/-/electron-to-chromium-1.4.528.tgz", @@ -1824,6 +2052,209 @@ "node": ">=8" } }, + "node_modules/eslint": { + "version": "8.52.0", + "resolved": "https://registry.npmjs.org/eslint/-/eslint-8.52.0.tgz", + "integrity": "sha512-zh/JHnaixqHZsolRB/w9/02akBk9EPrOs9JwcTP2ek7yL5bVvXuRariiaAjjoJ5DvuwQ1WAE/HsMz+w17YgBCg==", + "dev": true, + "dependencies": { + "@eslint-community/eslint-utils": "^4.2.0", + "@eslint-community/regexpp": "^4.6.1", + "@eslint/eslintrc": "^2.1.2", + "@eslint/js": "8.52.0", + "@humanwhocodes/config-array": "^0.11.13", + "@humanwhocodes/module-importer": "^1.0.1", + "@nodelib/fs.walk": "^1.2.8", + "@ungap/structured-clone": "^1.2.0", + "ajv": "^6.12.4", + "chalk": "^4.0.0", + "cross-spawn": "^7.0.2", + "debug": "^4.3.2", + "doctrine": "^3.0.0", + "escape-string-regexp": "^4.0.0", + "eslint-scope": "^7.2.2", + "eslint-visitor-keys": "^3.4.3", + "espree": "^9.6.1", + "esquery": "^1.4.2", + "esutils": "^2.0.2", + "fast-deep-equal": "^3.1.3", + "file-entry-cache": "^6.0.1", + "find-up": "^5.0.0", + "glob-parent": "^6.0.2", + "globals": "^13.19.0", + "graphemer": "^1.4.0", + "ignore": "^5.2.0", + "imurmurhash": "^0.1.4", + "is-glob": "^4.0.0", + "is-path-inside": "^3.0.3", + "js-yaml": "^4.1.0", + "json-stable-stringify-without-jsonify": "^1.0.1", + "levn": "^0.4.1", + "lodash.merge": "^4.6.2", + "minimatch": "^3.1.2", + "natural-compare": "^1.4.0", + "optionator": "^0.9.3", + "strip-ansi": "^6.0.1", + "text-table": "^0.2.0" + }, + "bin": { + "eslint": "bin/eslint.js" + }, + "engines": { + "node": "^12.22.0 || ^14.17.0 || >=16.0.0" + }, + "funding": { + "url": "https://opencollective.com/eslint" + } + }, + "node_modules/eslint-scope": { + "version": "7.2.2", + "resolved": "https://registry.npmjs.org/eslint-scope/-/eslint-scope-7.2.2.tgz", + "integrity": "sha512-dOt21O7lTMhDM+X9mB4GX+DZrZtCUJPL/wlcTqxyrx5IvO0IYtILdtrQGQp+8n5S0gwSVmOf9NQrjMOgfQZlIg==", + "dev": true, + "dependencies": { + "esrecurse": "^4.3.0", + "estraverse": "^5.2.0" + }, + "engines": { + "node": "^12.22.0 || ^14.17.0 || >=16.0.0" + }, + "funding": { + "url": "https://opencollective.com/eslint" + } + }, + "node_modules/eslint-visitor-keys": { + "version": "3.4.3", + "resolved": "https://registry.npmjs.org/eslint-visitor-keys/-/eslint-visitor-keys-3.4.3.tgz", + "integrity": "sha512-wpc+LXeiyiisxPlEkUzU6svyS1frIO3Mgxj1fdy7Pm8Ygzguax2N3Fa/D/ag1WqbOprdI+uY6wMUl8/a2G+iag==", + "dev": true, + "engines": { + "node": "^12.22.0 || ^14.17.0 || >=16.0.0" + }, + "funding": { + "url": "https://opencollective.com/eslint" + } + }, + "node_modules/eslint/node_modules/argparse": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/argparse/-/argparse-2.0.1.tgz", + "integrity": "sha512-8+9WqebbFzpX9OR+Wa6O29asIogeRMzcGtAINdpMHHyAg10f05aSFVBbcEqGf/PXw1EjAZ+q2/bEBg3DvurK3Q==", + "dev": true + }, + "node_modules/eslint/node_modules/escape-string-regexp": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/escape-string-regexp/-/escape-string-regexp-4.0.0.tgz", + "integrity": "sha512-TtpcNJ3XAzx3Gq8sWRzJaVajRs0uVxA2YAkdb1jm2YkPz4G6egUFAyA3n5vtEIZefPk5Wa4UXbKuS5fKkJWdgA==", + "dev": true, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/eslint/node_modules/find-up": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/find-up/-/find-up-5.0.0.tgz", + "integrity": "sha512-78/PXT1wlLLDgTzDs7sjq9hzz0vXD+zn+7wypEe4fXQxCmdmqfGsEPQxmiCSQI3ajFV91bVSsvNtrJRiW6nGng==", + "dev": true, + "dependencies": { + "locate-path": "^6.0.0", + "path-exists": "^4.0.0" + }, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/eslint/node_modules/globals": { + "version": "13.23.0", + "resolved": "https://registry.npmjs.org/globals/-/globals-13.23.0.tgz", + "integrity": "sha512-XAmF0RjlrjY23MA51q3HltdlGxUpXPvg0GioKiD9X6HD28iMjo2dKC8Vqwm7lne4GNr78+RHTfliktR6ZH09wA==", + "dev": true, + "dependencies": { + "type-fest": "^0.20.2" + }, + "engines": { + "node": ">=8" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/eslint/node_modules/js-yaml": { + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/js-yaml/-/js-yaml-4.1.0.tgz", + "integrity": "sha512-wpxZs9NoxZaJESJGIZTyDEaYpl0FKSA+FB9aJiyemKhMwkxQg63h4T1KJgUGHpTqPDNRcmmYLugrRjJlBtWvRA==", + "dev": true, + "dependencies": { + "argparse": "^2.0.1" + }, + "bin": { + "js-yaml": "bin/js-yaml.js" + } + }, + "node_modules/eslint/node_modules/locate-path": { + "version": "6.0.0", + "resolved": "https://registry.npmjs.org/locate-path/-/locate-path-6.0.0.tgz", + "integrity": "sha512-iPZK6eYjbxRu3uB4/WZ3EsEIMJFMqAoopl3R+zuq0UjcAm/MO6KCweDgPfP3elTztoKP3KtnVHxTn2NHBSDVUw==", + "dev": true, + "dependencies": { + "p-locate": "^5.0.0" + }, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/eslint/node_modules/p-locate": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/p-locate/-/p-locate-5.0.0.tgz", + "integrity": "sha512-LaNjtRWUBY++zB5nE/NwcaoMylSPk+S+ZHNB1TzdbMJMny6dynpAGt7X/tl/QYq3TIeE6nxHppbo2LGymrG5Pw==", + "dev": true, + "dependencies": { + "p-limit": "^3.0.2" + }, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/eslint/node_modules/type-fest": { + "version": "0.20.2", + "resolved": "https://registry.npmjs.org/type-fest/-/type-fest-0.20.2.tgz", + "integrity": "sha512-Ne+eE4r0/iWnpAxD852z3A+N0Bt5RN//NjJwRd2VFHEmrywxf5vsZlh4R6lixl6B+wz/8d+maTSAkN1FIkI3LQ==", + "dev": true, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/espree": { + "version": "9.6.1", + "resolved": "https://registry.npmjs.org/espree/-/espree-9.6.1.tgz", + "integrity": "sha512-oruZaFkjorTpF32kDSI5/75ViwGeZginGGy2NoOSg3Q9bnwlnmDm4HLnkl0RE3n+njDXR037aY1+x58Z/zFdwQ==", + "dev": true, + "dependencies": { + "acorn": "^8.9.0", + "acorn-jsx": "^5.3.2", + "eslint-visitor-keys": "^3.4.1" + }, + "engines": { + "node": "^12.22.0 || ^14.17.0 || >=16.0.0" + }, + "funding": { + "url": "https://opencollective.com/eslint" + } + }, "node_modules/esprima": { "version": "4.0.1", "resolved": "https://registry.npmjs.org/esprima/-/esprima-4.0.1.tgz", @@ -1837,6 +2268,48 @@ "node": ">=4" } }, + "node_modules/esquery": { + "version": "1.5.0", + "resolved": "https://registry.npmjs.org/esquery/-/esquery-1.5.0.tgz", + "integrity": "sha512-YQLXUplAwJgCydQ78IMJywZCceoqk1oH01OERdSAJc/7U2AylwjhSCLDEtqwg811idIS/9fIU5GjG73IgjKMVg==", + "dev": true, + "dependencies": { + "estraverse": "^5.1.0" + }, + "engines": { + "node": ">=0.10" + } + }, + "node_modules/esrecurse": { + "version": "4.3.0", + "resolved": "https://registry.npmjs.org/esrecurse/-/esrecurse-4.3.0.tgz", + "integrity": "sha512-KmfKL3b6G+RXvP8N1vr3Tq1kL/oCFgn2NYXEtqP8/L3pKapUA4G8cFVaoF3SU323CD4XypR/ffioHmkti6/Tag==", + "dev": true, + "dependencies": { + "estraverse": "^5.2.0" + }, + "engines": { + "node": ">=4.0" + } + }, + "node_modules/estraverse": { + "version": "5.3.0", + "resolved": "https://registry.npmjs.org/estraverse/-/estraverse-5.3.0.tgz", + "integrity": "sha512-MMdARuVEQziNTeJD8DgMqmhwR11BRQ/cBP+pLtYdSTnf3MIO8fFeiINEbX36ZdNlfU/7A9f3gUw49B3oQsvwBA==", + "dev": true, + "engines": { + "node": ">=4.0" + } + }, + "node_modules/esutils": { + "version": "2.0.3", + "resolved": "https://registry.npmjs.org/esutils/-/esutils-2.0.3.tgz", + "integrity": "sha512-kVscqXk4OCp68SZ0dkgEKVi6/8ij300KBWTJq32P/dYeWTSwK41WyTxalN1eRmA5Z9UU/LX9D7FWSmV9SAYx6g==", + "dev": true, + "engines": { + "node": ">=0.10.0" + } + }, "node_modules/execa": { "version": "5.1.1", "resolved": "https://registry.npmjs.org/execa/-/execa-5.1.1.tgz", @@ -1885,12 +2358,33 @@ "node": "^14.15.0 || ^16.10.0 || >=18.0.0" } }, + "node_modules/fast-deep-equal": { + "version": "3.1.3", + "resolved": "https://registry.npmjs.org/fast-deep-equal/-/fast-deep-equal-3.1.3.tgz", + "integrity": "sha512-f3qQ9oQy9j2AhBe/H9VC91wLmKBCCU/gDOnKNAYG5hswO7BLKj09Hc5HYNz9cGI++xlpDCIgDaitVs03ATR84Q==", + "dev": true + }, "node_modules/fast-json-stable-stringify": { "version": "2.1.0", "resolved": "https://registry.npmjs.org/fast-json-stable-stringify/-/fast-json-stable-stringify-2.1.0.tgz", "integrity": "sha512-lhd/wF+Lk98HZoTCtlVraHtfh5XYijIjalXck7saUtuanSDyLMxnHhSXEDJqHxD7msR8D0uCmqlkwjCV8xvwHw==", "dev": true }, + "node_modules/fast-levenshtein": { + "version": "2.0.6", + "resolved": "https://registry.npmjs.org/fast-levenshtein/-/fast-levenshtein-2.0.6.tgz", + "integrity": "sha512-DCXu6Ifhqcks7TZKY3Hxp3y6qphY5SJZmrWMDrKcERSOXWQdMhU9Ig/PYrzyw/ul9jOIyh0N4M0tbC5hodg8dw==", + "dev": true + }, + "node_modules/fastq": { + "version": "1.15.0", + "resolved": "https://registry.npmjs.org/fastq/-/fastq-1.15.0.tgz", + "integrity": "sha512-wBrocU2LCXXa+lWBt8RoIRD89Fi8OdABODa/kEnyeyjS5aZO5/GNvI5sEINADqP/h8M29UHTHUb53sUu5Ihqdw==", + "dev": true, + "dependencies": { + "reusify": "^1.0.4" + } + }, "node_modules/fb-watchman": { "version": "2.0.2", "resolved": "https://registry.npmjs.org/fb-watchman/-/fb-watchman-2.0.2.tgz", @@ -1900,6 +2394,18 @@ "bser": "2.1.1" } }, + "node_modules/file-entry-cache": { + "version": "6.0.1", + "resolved": "https://registry.npmjs.org/file-entry-cache/-/file-entry-cache-6.0.1.tgz", + "integrity": "sha512-7Gps/XWymbLk2QLYK4NzpMOrYjMhdIxXuIvy2QBsLE6ljuodKvdkWs/cpyJJ3CVIVpH0Oi1Hvg1ovbMzLdFBBg==", + "dev": true, + "dependencies": { + "flat-cache": "^3.0.4" + }, + "engines": { + "node": "^10.12.0 || >=12.0.0" + } + }, "node_modules/fill-range": { "version": "7.0.1", "resolved": "https://registry.npmjs.org/fill-range/-/fill-range-7.0.1.tgz", @@ -1925,6 +2431,26 @@ "node": ">=8" } }, + "node_modules/flat-cache": { + "version": "3.1.1", + "resolved": "https://registry.npmjs.org/flat-cache/-/flat-cache-3.1.1.tgz", + "integrity": "sha512-/qM2b3LUIaIgviBQovTLvijfyOQXPtSRnRK26ksj2J7rzPIecePUIpJsZ4T02Qg+xiAEKIs5K8dsHEd+VaKa/Q==", + "dev": true, + "dependencies": { + "flatted": "^3.2.9", + "keyv": "^4.5.3", + "rimraf": "^3.0.2" + }, + "engines": { + "node": ">=12.0.0" + } + }, + "node_modules/flatted": { + "version": "3.2.9", + "resolved": "https://registry.npmjs.org/flatted/-/flatted-3.2.9.tgz", + "integrity": "sha512-36yxDn5H7OFZQla0/jFJmbIKTdZAQHngCedGxiMmpNfEZM0sdEeT+WczLQrjK6D7o2aiyLYDnkw0R3JK0Qv1RQ==", + "dev": true + }, "node_modules/follow-redirects": { "version": "1.15.3", "resolved": "https://registry.npmjs.org/follow-redirects/-/follow-redirects-1.15.3.tgz", @@ -2042,6 +2568,18 @@ "url": "https://github.com/sponsors/isaacs" } }, + "node_modules/glob-parent": { + "version": "6.0.2", + "resolved": "https://registry.npmjs.org/glob-parent/-/glob-parent-6.0.2.tgz", + "integrity": "sha512-XxwI8EOhVQgWp6iDL+3b0r86f4d6AX6zSU55HfB4ydCEuXLXc5FcYeOu+nnGftS4TEju/11rt4KJPTMgbfmv4A==", + "dev": true, + "dependencies": { + "is-glob": "^4.0.3" + }, + "engines": { + "node": ">=10.13.0" + } + }, "node_modules/globals": { "version": "11.12.0", "resolved": "https://registry.npmjs.org/globals/-/globals-11.12.0.tgz", @@ -2057,6 +2595,12 @@ "integrity": "sha512-RbJ5/jmFcNNCcDV5o9eTnBLJ/HszWV0P73bc+Ff4nS/rJj+YaS6IGyiOL0VoBYX+l1Wrl3k63h/KrH+nhJ0XvQ==", "dev": true }, + "node_modules/graphemer": { + "version": "1.4.0", + "resolved": "https://registry.npmjs.org/graphemer/-/graphemer-1.4.0.tgz", + "integrity": "sha512-EtKwoO6kxCL9WO5xipiHTZlSzBm7WLT627TqC/uVRd0HKmq8NXyebnNYxDoBi7wt8eTWrUrKXCOVaFq9x1kgag==", + "dev": true + }, "node_modules/has": { "version": "1.0.3", "resolved": "https://registry.npmjs.org/has/-/has-1.0.3.tgz", @@ -2093,6 +2637,40 @@ "node": ">=10.17.0" } }, + "node_modules/ignore": { + "version": "5.2.4", + "resolved": "https://registry.npmjs.org/ignore/-/ignore-5.2.4.tgz", + "integrity": "sha512-MAb38BcSbH0eHNBxn7ql2NH/kX33OkB3lZ1BNdh7ENeRChHTYsTvWrMubiIAMNS2llXEEgZ1MUOBtXChP3kaFQ==", + "dev": true, + "engines": { + "node": ">= 4" + } + }, + "node_modules/import-fresh": { + "version": "3.3.0", + "resolved": "https://registry.npmjs.org/import-fresh/-/import-fresh-3.3.0.tgz", + "integrity": "sha512-veYYhQa+D1QBKznvhUHxb8faxlrwUnxseDAbAp457E0wLNio2bOSKnjYDhMj+YiAq61xrMGhQk9iXVk5FzgQMw==", + "dev": true, + "dependencies": { + "parent-module": "^1.0.0", + "resolve-from": "^4.0.0" + }, + "engines": { + "node": ">=6" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/import-fresh/node_modules/resolve-from": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/resolve-from/-/resolve-from-4.0.0.tgz", + "integrity": "sha512-pb/MYmXstAkysRFx8piNI1tGFNQIFA3vkE3Gq4EuA1dF6gHp/+vgZqsCGJapvy8N3Q+4o7FwvquPJcnZ7RYy4g==", + "dev": true, + "engines": { + "node": ">=4" + } + }, "node_modules/import-local": { "version": "3.1.0", "resolved": "https://registry.npmjs.org/import-local/-/import-local-3.1.0.tgz", @@ -2155,6 +2733,15 @@ "url": "https://github.com/sponsors/ljharb" } }, + "node_modules/is-extglob": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/is-extglob/-/is-extglob-2.1.1.tgz", + "integrity": "sha512-SbKbANkN603Vi4jEZv49LeVJMn4yGwsbzZworEoyEiutsN3nJYdbO36zfhGJ6QEDpOZIFkDtnq5JRxmvl3jsoQ==", + "dev": true, + "engines": { + "node": ">=0.10.0" + } + }, "node_modules/is-fullwidth-code-point": { "version": "3.0.0", "resolved": "https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-3.0.0.tgz", @@ -2173,6 +2760,18 @@ "node": ">=6" } }, + "node_modules/is-glob": { + "version": "4.0.3", + "resolved": "https://registry.npmjs.org/is-glob/-/is-glob-4.0.3.tgz", + "integrity": "sha512-xelSayHH36ZgE7ZWhli7pW34hNbNl8Ojv5KVmkJD4hBdD3th8Tfk9vYasLM+mXWOZhFkgZfxhLSnrwRr4elSSg==", + "dev": true, + "dependencies": { + "is-extglob": "^2.1.1" + }, + "engines": { + "node": ">=0.10.0" + } + }, "node_modules/is-number": { "version": "7.0.0", "resolved": "https://registry.npmjs.org/is-number/-/is-number-7.0.0.tgz", @@ -2182,6 +2781,15 @@ "node": ">=0.12.0" } }, + "node_modules/is-path-inside": { + "version": "3.0.3", + "resolved": "https://registry.npmjs.org/is-path-inside/-/is-path-inside-3.0.3.tgz", + "integrity": "sha512-Fd4gABb+ycGAmKou8eMftCupSir5lRxqf4aD/vd0cD2qc4HL07OjCeuHMr8Ro4CoMaeCKDB0/ECBOVWjTwUvPQ==", + "dev": true, + "engines": { + "node": ">=8" + } + }, "node_modules/is-stream": { "version": "2.0.1", "resolved": "https://registry.npmjs.org/is-stream/-/is-stream-2.0.1.tgz", @@ -2918,12 +3526,30 @@ "node": ">=4" } }, + "node_modules/json-buffer": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/json-buffer/-/json-buffer-3.0.1.tgz", + "integrity": "sha512-4bV5BfR2mqfQTJm+V5tPPdf+ZpuhiIvTuAB5g8kcrXOZpTT/QwwVRWBywX1ozr6lEuPdbHxwaJlm9G6mI2sfSQ==", + "dev": true + }, "node_modules/json-parse-even-better-errors": { "version": "2.3.1", "resolved": "https://registry.npmjs.org/json-parse-even-better-errors/-/json-parse-even-better-errors-2.3.1.tgz", "integrity": "sha512-xyFwyhro/JEof6Ghe2iz2NcXoj2sloNsWr/XsERDK/oiPCfaNhl5ONfp+jQdAZRQQ0IJWNzH9zIZF7li91kh2w==", "dev": true }, + "node_modules/json-schema-traverse": { + "version": "0.4.1", + "resolved": "https://registry.npmjs.org/json-schema-traverse/-/json-schema-traverse-0.4.1.tgz", + "integrity": "sha512-xbbCH5dCYU5T8LcEhhuh7HJ88HXuW3qsI3Y0zOZFKfZEHcpWiHU/Jxzk629Brsab/mMiHQti9wMP+845RPe3Vg==", + "dev": true + }, + "node_modules/json-stable-stringify-without-jsonify": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/json-stable-stringify-without-jsonify/-/json-stable-stringify-without-jsonify-1.0.1.tgz", + "integrity": "sha512-Bdboy+l7tA3OGW6FjyFHWkP5LuByj1Tk33Ljyq0axyzdk9//JSi2u3fP1QSmd1KNwq6VOKYGlAu87CisVir6Pw==", + "dev": true + }, "node_modules/json5": { "version": "2.2.3", "resolved": "https://registry.npmjs.org/json5/-/json5-2.2.3.tgz", @@ -2936,6 +3562,15 @@ "node": ">=6" } }, + "node_modules/keyv": { + "version": "4.5.4", + "resolved": "https://registry.npmjs.org/keyv/-/keyv-4.5.4.tgz", + "integrity": "sha512-oxVHkHR/EJf2CNXnWxRLW6mg7JyCCUcG0DtEGmL2ctUo1PNTin1PUil+r/+4r5MpVgC/fn1kjsx7mjSujKqIpw==", + "dev": true, + "dependencies": { + "json-buffer": "3.0.1" + } + }, "node_modules/kleur": { "version": "3.0.3", "resolved": "https://registry.npmjs.org/kleur/-/kleur-3.0.3.tgz", @@ -2954,6 +3589,19 @@ "node": ">=6" } }, + "node_modules/levn": { + "version": "0.4.1", + "resolved": "https://registry.npmjs.org/levn/-/levn-0.4.1.tgz", + "integrity": "sha512-+bT2uH4E5LGE7h/n3evcS/sQlJXCpIp6ym8OWJ5eV6+67Dsql/LaaT7qJBAt2rzfoa/5QBGBhxDix1dMt2kQKQ==", + "dev": true, + "dependencies": { + "prelude-ls": "^1.2.1", + "type-check": "~0.4.0" + }, + "engines": { + "node": ">= 0.8.0" + } + }, "node_modules/lines-and-columns": { "version": "1.2.4", "resolved": "https://registry.npmjs.org/lines-and-columns/-/lines-and-columns-1.2.4.tgz", @@ -2978,6 +3626,12 @@ "integrity": "sha512-t7j+NzmgnQzTAYXcsHYLgimltOV1MXHtlOWf6GjL9Kj8GK5FInw5JotxvbOs+IvV1/Dzo04/fCGfLVs7aXb4Ag==", "dev": true }, + "node_modules/lodash.merge": { + "version": "4.6.2", + "resolved": "https://registry.npmjs.org/lodash.merge/-/lodash.merge-4.6.2.tgz", + "integrity": "sha512-0KpjqXRVvrYyCsX1swR/XTK0va6VQkQM6MNo7PqW77ByjAhoARA8EfrP1N4+KlKj8YS0ZUCtRT/YUuhyYDujIQ==", + "dev": true + }, "node_modules/lru-cache": { "version": "5.1.1", "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-5.1.1.tgz", @@ -3177,6 +3831,23 @@ "url": "https://github.com/sponsors/sindresorhus" } }, + "node_modules/optionator": { + "version": "0.9.3", + "resolved": "https://registry.npmjs.org/optionator/-/optionator-0.9.3.tgz", + "integrity": "sha512-JjCoypp+jKn1ttEFExxhetCKeJt9zhAgAve5FXHixTvFDW/5aEktX9bufBKLRRMdU7bNtpLfcGu94B3cdEJgjg==", + "dev": true, + "dependencies": { + "@aashutoshrathi/word-wrap": "^1.2.3", + "deep-is": "^0.1.3", + "fast-levenshtein": "^2.0.6", + "levn": "^0.4.1", + "prelude-ls": "^1.2.1", + "type-check": "^0.4.0" + }, + "engines": { + "node": ">= 0.8.0" + } + }, "node_modules/p-limit": { "version": "3.1.0", "resolved": "https://registry.npmjs.org/p-limit/-/p-limit-3.1.0.tgz", @@ -3228,6 +3899,18 @@ "node": ">=6" } }, + "node_modules/parent-module": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/parent-module/-/parent-module-1.0.1.tgz", + "integrity": "sha512-GQ2EWRpQV8/o+Aw8YqtfZZPfNRWZYkbidE9k5rpl/hC3vtHHBfGm2Ifi6qWV+coDGkrUKZAxE3Lot5kcsRlh+g==", + "dev": true, + "dependencies": { + "callsites": "^3.0.0" + }, + "engines": { + "node": ">=6" + } + }, "node_modules/parse-json": { "version": "5.2.0", "resolved": "https://registry.npmjs.org/parse-json/-/parse-json-5.2.0.tgz", @@ -3318,6 +4001,15 @@ "node": ">=8" } }, + "node_modules/prelude-ls": { + "version": "1.2.1", + "resolved": "https://registry.npmjs.org/prelude-ls/-/prelude-ls-1.2.1.tgz", + "integrity": "sha512-vkcDPrRZo1QZLbn5RLGPpg/WmIQ65qoWWhcGKf/b5eplkkarX0m9z8ppCat4mlOqUsWpyNuYgO3VRyrYHSzX5g==", + "dev": true, + "engines": { + "node": ">= 0.8.0" + } + }, "node_modules/pretty-format": { "version": "29.7.0", "resolved": "https://registry.npmjs.org/pretty-format/-/pretty-format-29.7.0.tgz", @@ -3362,6 +4054,15 @@ "resolved": "https://registry.npmjs.org/proxy-from-env/-/proxy-from-env-1.1.0.tgz", "integrity": "sha512-D+zkORCbA9f1tdWRK0RaCR3GPv50cMxcrz4X8k5LTSUD1Dkw47mKJEZQNunItRTkWwgtaUSo1RVFRIG9ZXiFYg==" }, + "node_modules/punycode": { + "version": "2.3.0", + "resolved": "https://registry.npmjs.org/punycode/-/punycode-2.3.0.tgz", + "integrity": "sha512-rRV+zQD8tVFys26lAGR9WUuS4iUAngJScM+ZRSKtvl5tKeZ2t5bvdNFdNHBW9FWR4guGHlgmsZ1G7BSm2wTbuA==", + "dev": true, + "engines": { + "node": ">=6" + } + }, "node_modules/pure-rand": { "version": "6.0.3", "resolved": "https://registry.npmjs.org/pure-rand/-/pure-rand-6.0.3.tgz", @@ -3378,6 +4079,26 @@ } ] }, + "node_modules/queue-microtask": { + "version": "1.2.3", + "resolved": "https://registry.npmjs.org/queue-microtask/-/queue-microtask-1.2.3.tgz", + "integrity": "sha512-NuaNSa6flKT5JaSYQzJok04JzTL1CA6aGhv5rfLW3PgqA+M2ChpZQnAC8h8i4ZFkBS8X5RqkDBHA7r4hej3K9A==", + "dev": true, + "funding": [ + { + "type": "github", + "url": "https://github.com/sponsors/feross" + }, + { + "type": "patreon", + "url": "https://www.patreon.com/feross" + }, + { + "type": "consulting", + "url": "https://feross.org/support" + } + ] + }, "node_modules/react-is": { "version": "18.2.0", "resolved": "https://registry.npmjs.org/react-is/-/react-is-18.2.0.tgz", @@ -3440,6 +4161,54 @@ "node": ">=10" } }, + "node_modules/reusify": { + "version": "1.0.4", + "resolved": "https://registry.npmjs.org/reusify/-/reusify-1.0.4.tgz", + "integrity": "sha512-U9nH88a3fc/ekCF1l0/UP1IosiuIjyTh7hBvXVMHYgVcfGvt897Xguj2UOLDeI5BG2m7/uwyaLVT6fbtCwTyzw==", + "dev": true, + "engines": { + "iojs": ">=1.0.0", + "node": ">=0.10.0" + } + }, + "node_modules/rimraf": { + "version": "3.0.2", + "resolved": "https://registry.npmjs.org/rimraf/-/rimraf-3.0.2.tgz", + "integrity": "sha512-JZkJMZkAGFFPP2YqXZXPbMlMBgsxzE8ILs4lMIX/2o0L9UBw9O/Y3o6wFw/i9YLapcUJWwqbi3kdxIPdC62TIA==", + "dev": true, + "dependencies": { + "glob": "^7.1.3" + }, + "bin": { + "rimraf": "bin.js" + }, + "funding": { + "url": "https://github.com/sponsors/isaacs" + } + }, + "node_modules/run-parallel": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/run-parallel/-/run-parallel-1.2.0.tgz", + "integrity": "sha512-5l4VyZR86LZ/lDxZTR6jqL8AFE2S0IFLMP26AbjsLVADxHdhB/c0GUsH+y39UfCi3dzz8OlQuPmnaJOMoDHQBA==", + "dev": true, + "funding": [ + { + "type": "github", + "url": "https://github.com/sponsors/feross" + }, + { + "type": "patreon", + "url": "https://www.patreon.com/feross" + }, + { + "type": "consulting", + "url": "https://feross.org/support" + } + ], + "dependencies": { + "queue-microtask": "^1.2.2" + } + }, "node_modules/semver": { "version": "6.3.1", "resolved": "https://registry.npmjs.org/semver/-/semver-6.3.1.tgz", @@ -3635,6 +4404,12 @@ "node": ">=8" } }, + "node_modules/text-table": { + "version": "0.2.0", + "resolved": "https://registry.npmjs.org/text-table/-/text-table-0.2.0.tgz", + "integrity": "sha512-N+8UisAXDGk8PFXP4HAzVR9nbfmVJ3zYLAWiTIoqC5v5isinhr+r5uaO8+7r3BMfuNIufIsA7RdpVgacC2cSpw==", + "dev": true + }, "node_modules/tmpl": { "version": "1.0.5", "resolved": "https://registry.npmjs.org/tmpl/-/tmpl-1.0.5.tgz", @@ -3780,6 +4555,18 @@ } } }, + "node_modules/type-check": { + "version": "0.4.0", + "resolved": "https://registry.npmjs.org/type-check/-/type-check-0.4.0.tgz", + "integrity": "sha512-XleUoc9uwGXqjWwXaUTZAmzMcFZ5858QA2vvx1Ur5xIcixXIP+8LnFDgRplU30us6teqdlskFfu+ae4K79Ooew==", + "dev": true, + "dependencies": { + "prelude-ls": "^1.2.1" + }, + "engines": { + "node": ">= 0.8.0" + } + }, "node_modules/type-detect": { "version": "4.0.8", "resolved": "https://registry.npmjs.org/type-detect/-/type-detect-4.0.8.tgz", @@ -3843,6 +4630,15 @@ "browserslist": ">= 4.21.0" } }, + "node_modules/uri-js": { + "version": "4.4.1", + "resolved": "https://registry.npmjs.org/uri-js/-/uri-js-4.4.1.tgz", + "integrity": "sha512-7rKUyy33Q1yc98pQ1DAmLtwX109F7TIfWlW1Ydo8Wl1ii1SeHieeh0HHfPeL2fMXK6z0s8ecKs9frCuLJvndBg==", + "dev": true, + "dependencies": { + "punycode": "^2.1.0" + } + }, "node_modules/v8-compile-cache-lib": { "version": "3.0.1", "resolved": "https://registry.npmjs.org/v8-compile-cache-lib/-/v8-compile-cache-lib-3.0.1.tgz", diff --git a/package.json b/package.json index d9669c4..d0b7ef9 100644 --- a/package.json +++ b/package.json @@ -12,6 +12,7 @@ "devDependencies": { "@types/jest": "^29.5.5", "@types/node": "^20.6.5", + "eslint": "^8.52.0", "jest": "^29.7.0", "ts-jest": "^29.1.1", "typescript": "^5.2.2" diff --git a/settings.json b/settings.json deleted file mode 100644 index 5f2f9b0..0000000 --- a/settings.json +++ /dev/null @@ -1 +0,0 @@ -{ "git.enableCommitSigning": true } diff --git a/tsconfig.json b/tsconfig.json index b3b3667..0153767 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -8,5 +8,5 @@ "outDir": "dist", "baseUrl": "*" }, - "include": ["**/**/*", "*"] + "include": ["**/**/*", "*", "jest.config.js"] } From 4a70f79f2b98a3c25e0b369683b16ff32f77c3c1 Mon Sep 17 00:00:00 2001 From: Erik Date: Sun, 22 Oct 2023 14:33:36 +0200 Subject: [PATCH 7/8] Moved all source code into src dir. --- {Class => src/Class}/Graph.ts | 0 {Class => src/Class}/Groups.ts | 7 +------ {Class => src/Class}/PriorityQueue.ts | 0 {alg => src/alg}/TimeDistribution.ts | 18 ++++++++---------- .../TimeDistribution/AllocateGroupsToItems.ts | 0 .../alg}/TimeDistribution/CreateGraph.ts | 0 .../alg}/TimeDistribution/DistributeGroups.ts | 0 {alg => src/alg}/TimeDistribution/FindPaths.ts | 0 {alg => src/alg}/TimeDistribution/Utils.ts | 0 {api => src/api}/travelModule.ts | 0 {data => src/data}/Items.ts | 0 {data => src/data}/Polls.ts | 0 {data => src/data}/Projects.ts | 2 +- {data => src/data}/Rooms.ts | 0 {data => src/data}/Students.ts | 0 index.ts => src/index.ts | 0 src/types/Group.ts | 5 +++++ {types => src/types}/Item.ts | 0 {types => src/types}/Path.ts | 0 {types => src/types}/Polls.ts | 0 {types => src/types}/Project.ts | 0 {types => src/types}/Room.ts | 0 {types => src/types}/Student.ts | 0 {utils => src/utils}/array.ts | 0 test/Groups.test.ts | 2 +- test/data.ts | 8 ++++---- test/graph.test.ts | 2 +- test/pq.test.ts | 2 +- test/timeDistribution.test.ts | 5 +++-- test/utils/array.test.ts | 2 +- 30 files changed, 26 insertions(+), 27 deletions(-) rename {Class => src/Class}/Graph.ts (100%) rename {Class => src/Class}/Groups.ts (89%) rename {Class => src/Class}/PriorityQueue.ts (100%) rename {alg => src/alg}/TimeDistribution.ts (96%) rename {alg => src/alg}/TimeDistribution/AllocateGroupsToItems.ts (100%) rename {alg => src/alg}/TimeDistribution/CreateGraph.ts (100%) rename {alg => src/alg}/TimeDistribution/DistributeGroups.ts (100%) rename {alg => src/alg}/TimeDistribution/FindPaths.ts (100%) rename {alg => src/alg}/TimeDistribution/Utils.ts (100%) rename {api => src/api}/travelModule.ts (100%) rename {data => src/data}/Items.ts (100%) rename {data => src/data}/Polls.ts (100%) rename {data => src/data}/Projects.ts (87%) rename {data => src/data}/Rooms.ts (100%) rename {data => src/data}/Students.ts (100%) rename index.ts => src/index.ts (100%) create mode 100644 src/types/Group.ts rename {types => src/types}/Item.ts (100%) rename {types => src/types}/Path.ts (100%) rename {types => src/types}/Polls.ts (100%) rename {types => src/types}/Project.ts (100%) rename {types => src/types}/Room.ts (100%) rename {types => src/types}/Student.ts (100%) rename {utils => src/utils}/array.ts (100%) diff --git a/Class/Graph.ts b/src/Class/Graph.ts similarity index 100% rename from Class/Graph.ts rename to src/Class/Graph.ts diff --git a/Class/Groups.ts b/src/Class/Groups.ts similarity index 89% rename from Class/Groups.ts rename to src/Class/Groups.ts index 44f1dc9..4f8a13b 100644 --- a/Class/Groups.ts +++ b/src/Class/Groups.ts @@ -1,11 +1,6 @@ +import { Group } from "../types/Group"; import { arraysHaveSameValues } from "../utils/array"; -interface Group { - id: number; - path: string[]; - studentIds: string[]; -} - class Groups { private groups: Group[] = []; diff --git a/Class/PriorityQueue.ts b/src/Class/PriorityQueue.ts similarity index 100% rename from Class/PriorityQueue.ts rename to src/Class/PriorityQueue.ts diff --git a/alg/TimeDistribution.ts b/src/alg/TimeDistribution.ts similarity index 96% rename from alg/TimeDistribution.ts rename to src/alg/TimeDistribution.ts index 0c9423d..248bd3f 100644 --- a/alg/TimeDistribution.ts +++ b/src/alg/TimeDistribution.ts @@ -1,17 +1,15 @@ -import { DirectedGraph, GraphNode } from "../Class/Graph"; -import Project from "../types/Project"; -import Student from "../types/Student"; -import Item from "../types/Item"; -import PollQuestion from "../types/Polls"; - -import createGraph from "./TimeDistribution/CreateGraph"; import { Group, Groups } from "../Class/Groups"; import { PriorityQueue } from "../Class/PriorityQueue"; -import { Path } from "../types/Path"; -import { findPathsForEachGroup } from "./TimeDistribution/FindPaths"; +import PollQuestion from "../types/Polls"; +import Student from "../types/Student"; +import createGraph from "./TimeDistribution/CreateGraph"; import { distributeGroupsToPaths } from "./TimeDistribution/DistributeGroups"; -import { allocateGroupsToItems } from "./TimeDistribution/AllocateGroupsToItems"; +import { findPathsForEachGroup } from "./TimeDistribution/FindPaths"; import { getVotingIds } from "./TimeDistribution/Utils"; +import { allocateGroupsToItems } from "./TimeDistribution/AllocateGroupsToItems"; +import Item from "../types/Item"; +import Project from "../types/Project"; +import { Path } from "../types/Path"; function buildGroupsWithSamePaths( polls: PollQuestion[], diff --git a/alg/TimeDistribution/AllocateGroupsToItems.ts b/src/alg/TimeDistribution/AllocateGroupsToItems.ts similarity index 100% rename from alg/TimeDistribution/AllocateGroupsToItems.ts rename to src/alg/TimeDistribution/AllocateGroupsToItems.ts diff --git a/alg/TimeDistribution/CreateGraph.ts b/src/alg/TimeDistribution/CreateGraph.ts similarity index 100% rename from alg/TimeDistribution/CreateGraph.ts rename to src/alg/TimeDistribution/CreateGraph.ts diff --git a/alg/TimeDistribution/DistributeGroups.ts b/src/alg/TimeDistribution/DistributeGroups.ts similarity index 100% rename from alg/TimeDistribution/DistributeGroups.ts rename to src/alg/TimeDistribution/DistributeGroups.ts diff --git a/alg/TimeDistribution/FindPaths.ts b/src/alg/TimeDistribution/FindPaths.ts similarity index 100% rename from alg/TimeDistribution/FindPaths.ts rename to src/alg/TimeDistribution/FindPaths.ts diff --git a/alg/TimeDistribution/Utils.ts b/src/alg/TimeDistribution/Utils.ts similarity index 100% rename from alg/TimeDistribution/Utils.ts rename to src/alg/TimeDistribution/Utils.ts diff --git a/api/travelModule.ts b/src/api/travelModule.ts similarity index 100% rename from api/travelModule.ts rename to src/api/travelModule.ts diff --git a/data/Items.ts b/src/data/Items.ts similarity index 100% rename from data/Items.ts rename to src/data/Items.ts diff --git a/data/Polls.ts b/src/data/Polls.ts similarity index 100% rename from data/Polls.ts rename to src/data/Polls.ts diff --git a/data/Projects.ts b/src/data/Projects.ts similarity index 87% rename from data/Projects.ts rename to src/data/Projects.ts index 09c9dfb..a301051 100644 --- a/data/Projects.ts +++ b/src/data/Projects.ts @@ -1,4 +1,4 @@ -import { Project } from "../test/data"; +import { Project } from "../../test/data"; const berlin: Project = { _id: "projectId1", diff --git a/data/Rooms.ts b/src/data/Rooms.ts similarity index 100% rename from data/Rooms.ts rename to src/data/Rooms.ts diff --git a/data/Students.ts b/src/data/Students.ts similarity index 100% rename from data/Students.ts rename to src/data/Students.ts diff --git a/index.ts b/src/index.ts similarity index 100% rename from index.ts rename to src/index.ts diff --git a/src/types/Group.ts b/src/types/Group.ts new file mode 100644 index 0000000..6fe1794 --- /dev/null +++ b/src/types/Group.ts @@ -0,0 +1,5 @@ +export interface Group { + id: number; + path: string[]; + studentIds: string[]; +} diff --git a/types/Item.ts b/src/types/Item.ts similarity index 100% rename from types/Item.ts rename to src/types/Item.ts diff --git a/types/Path.ts b/src/types/Path.ts similarity index 100% rename from types/Path.ts rename to src/types/Path.ts diff --git a/types/Polls.ts b/src/types/Polls.ts similarity index 100% rename from types/Polls.ts rename to src/types/Polls.ts diff --git a/types/Project.ts b/src/types/Project.ts similarity index 100% rename from types/Project.ts rename to src/types/Project.ts diff --git a/types/Room.ts b/src/types/Room.ts similarity index 100% rename from types/Room.ts rename to src/types/Room.ts diff --git a/types/Student.ts b/src/types/Student.ts similarity index 100% rename from types/Student.ts rename to src/types/Student.ts diff --git a/utils/array.ts b/src/utils/array.ts similarity index 100% rename from utils/array.ts rename to src/utils/array.ts diff --git a/test/Groups.test.ts b/test/Groups.test.ts index d8e729d..9675dd9 100644 --- a/test/Groups.test.ts +++ b/test/Groups.test.ts @@ -1,4 +1,4 @@ -import { Groups, Group } from "../Class/Groups"; +import { Groups, Group } from "../src/Class/Groups"; describe("Groups class", () => { let groups: Groups; diff --git a/test/data.ts b/test/data.ts index 7a6445f..d76a676 100644 --- a/test/data.ts +++ b/test/data.ts @@ -1,7 +1,7 @@ -import PollQuestion from "../types/Polls"; -import Student from "../types/Student"; -import Item from "../types/Item"; -import Project from "./../types/Project"; +import PollQuestion from "../src/types/Polls"; +import Student from "../src/types/Student"; +import Item from "../src/types/Item"; +import Project from "../src/types/Project"; const items: Item[] = [ { diff --git a/test/graph.test.ts b/test/graph.test.ts index 389372e..987aed7 100644 --- a/test/graph.test.ts +++ b/test/graph.test.ts @@ -1,4 +1,4 @@ -import { DirectedGraph, GraphNode } from "../Class/Graph"; // Replace with your actual file path +import { DirectedGraph } from "../src/Class/Graph"; // Replace with your actual file path describe("DirectedGraph", () => { it("should add nodes correctly", () => { diff --git a/test/pq.test.ts b/test/pq.test.ts index a7aa32d..2523f40 100644 --- a/test/pq.test.ts +++ b/test/pq.test.ts @@ -1,4 +1,4 @@ -import { PriorityQueue } from "../Class/PriorityQueue"; +import { PriorityQueue } from "../src/Class/PriorityQueue"; describe("PriorityQueue", () => { it("should enqueue elements with proper priority and dequeue in correct order", () => { diff --git a/test/timeDistribution.test.ts b/test/timeDistribution.test.ts index 4ad2bde..e236592 100644 --- a/test/timeDistribution.test.ts +++ b/test/timeDistribution.test.ts @@ -1,8 +1,9 @@ -import { getVotingIds, main } from "../alg/TimeDistribution"; +import { main } from "../src/alg/TimeDistribution"; import { findItemsByStudentId, getDefaultIds, -} from "../alg/TimeDistribution/Utils"; + getVotingIds, +} from "../src/alg/TimeDistribution/Utils"; import { items, polls, students, project } from "./data"; describe("Time Distribution Algorithm", () => { diff --git a/test/utils/array.test.ts b/test/utils/array.test.ts index 21e5a1c..9c3f9fc 100644 --- a/test/utils/array.test.ts +++ b/test/utils/array.test.ts @@ -1,4 +1,4 @@ -import { arraysHaveSameValues } from "../../utils/array"; +import { arraysHaveSameValues } from "../../src/utils/array"; describe("arraysHaveSameValues", () => { it("should return true for arrays with the same values", () => { From d4dbcce4506fbc6824e2f3eb5aaaf0e0dbee82f9 Mon Sep 17 00:00:00 2001 From: Erik Date: Sun, 22 Oct 2023 14:33:36 +0200 Subject: [PATCH 8/8] Moved all source code into src dir. --- {Class => src/Class}/Graph.ts | 0 {Class => src/Class}/Groups.ts | 7 +------ {Class => src/Class}/PriorityQueue.ts | 0 {alg => src/alg}/TimeDistribution.ts | 18 ++++++++---------- .../TimeDistribution/AllocateGroupsToItems.ts | 0 .../alg}/TimeDistribution/CreateGraph.ts | 0 .../alg}/TimeDistribution/DistributeGroups.ts | 0 {alg => src/alg}/TimeDistribution/FindPaths.ts | 0 {alg => src/alg}/TimeDistribution/Utils.ts | 0 {api => src/api}/travelModule.ts | 0 {data => src/data}/Items.ts | 0 {data => src/data}/Polls.ts | 0 {data => src/data}/Projects.ts | 2 +- {data => src/data}/Rooms.ts | 0 {data => src/data}/Students.ts | 0 index.ts => src/index.ts | 0 src/types/Group.ts | 5 +++++ {types => src/types}/Item.ts | 0 {types => src/types}/Path.ts | 0 {types => src/types}/Polls.ts | 0 {types => src/types}/Project.ts | 0 {types => src/types}/Room.ts | 0 {types => src/types}/Student.ts | 0 {utils => src/utils}/array.ts | 0 test/Groups.test.ts | 2 +- test/data.ts | 8 ++++---- test/graph.test.ts | 2 +- test/pq.test.ts | 2 +- test/timeDistribution.test.ts | 5 +++-- test/utils/array.test.ts | 2 +- 30 files changed, 26 insertions(+), 27 deletions(-) rename {Class => src/Class}/Graph.ts (100%) rename {Class => src/Class}/Groups.ts (89%) rename {Class => src/Class}/PriorityQueue.ts (100%) rename {alg => src/alg}/TimeDistribution.ts (96%) rename {alg => src/alg}/TimeDistribution/AllocateGroupsToItems.ts (100%) rename {alg => src/alg}/TimeDistribution/CreateGraph.ts (100%) rename {alg => src/alg}/TimeDistribution/DistributeGroups.ts (100%) rename {alg => src/alg}/TimeDistribution/FindPaths.ts (100%) rename {alg => src/alg}/TimeDistribution/Utils.ts (100%) rename {api => src/api}/travelModule.ts (100%) rename {data => src/data}/Items.ts (100%) rename {data => src/data}/Polls.ts (100%) rename {data => src/data}/Projects.ts (87%) rename {data => src/data}/Rooms.ts (100%) rename {data => src/data}/Students.ts (100%) rename index.ts => src/index.ts (100%) create mode 100644 src/types/Group.ts rename {types => src/types}/Item.ts (100%) rename {types => src/types}/Path.ts (100%) rename {types => src/types}/Polls.ts (100%) rename {types => src/types}/Project.ts (100%) rename {types => src/types}/Room.ts (100%) rename {types => src/types}/Student.ts (100%) rename {utils => src/utils}/array.ts (100%) diff --git a/Class/Graph.ts b/src/Class/Graph.ts similarity index 100% rename from Class/Graph.ts rename to src/Class/Graph.ts diff --git a/Class/Groups.ts b/src/Class/Groups.ts similarity index 89% rename from Class/Groups.ts rename to src/Class/Groups.ts index 44f1dc9..4f8a13b 100644 --- a/Class/Groups.ts +++ b/src/Class/Groups.ts @@ -1,11 +1,6 @@ +import { Group } from "../types/Group"; import { arraysHaveSameValues } from "../utils/array"; -interface Group { - id: number; - path: string[]; - studentIds: string[]; -} - class Groups { private groups: Group[] = []; diff --git a/Class/PriorityQueue.ts b/src/Class/PriorityQueue.ts similarity index 100% rename from Class/PriorityQueue.ts rename to src/Class/PriorityQueue.ts diff --git a/alg/TimeDistribution.ts b/src/alg/TimeDistribution.ts similarity index 96% rename from alg/TimeDistribution.ts rename to src/alg/TimeDistribution.ts index 0c9423d..248bd3f 100644 --- a/alg/TimeDistribution.ts +++ b/src/alg/TimeDistribution.ts @@ -1,17 +1,15 @@ -import { DirectedGraph, GraphNode } from "../Class/Graph"; -import Project from "../types/Project"; -import Student from "../types/Student"; -import Item from "../types/Item"; -import PollQuestion from "../types/Polls"; - -import createGraph from "./TimeDistribution/CreateGraph"; import { Group, Groups } from "../Class/Groups"; import { PriorityQueue } from "../Class/PriorityQueue"; -import { Path } from "../types/Path"; -import { findPathsForEachGroup } from "./TimeDistribution/FindPaths"; +import PollQuestion from "../types/Polls"; +import Student from "../types/Student"; +import createGraph from "./TimeDistribution/CreateGraph"; import { distributeGroupsToPaths } from "./TimeDistribution/DistributeGroups"; -import { allocateGroupsToItems } from "./TimeDistribution/AllocateGroupsToItems"; +import { findPathsForEachGroup } from "./TimeDistribution/FindPaths"; import { getVotingIds } from "./TimeDistribution/Utils"; +import { allocateGroupsToItems } from "./TimeDistribution/AllocateGroupsToItems"; +import Item from "../types/Item"; +import Project from "../types/Project"; +import { Path } from "../types/Path"; function buildGroupsWithSamePaths( polls: PollQuestion[], diff --git a/alg/TimeDistribution/AllocateGroupsToItems.ts b/src/alg/TimeDistribution/AllocateGroupsToItems.ts similarity index 100% rename from alg/TimeDistribution/AllocateGroupsToItems.ts rename to src/alg/TimeDistribution/AllocateGroupsToItems.ts diff --git a/alg/TimeDistribution/CreateGraph.ts b/src/alg/TimeDistribution/CreateGraph.ts similarity index 100% rename from alg/TimeDistribution/CreateGraph.ts rename to src/alg/TimeDistribution/CreateGraph.ts diff --git a/alg/TimeDistribution/DistributeGroups.ts b/src/alg/TimeDistribution/DistributeGroups.ts similarity index 100% rename from alg/TimeDistribution/DistributeGroups.ts rename to src/alg/TimeDistribution/DistributeGroups.ts diff --git a/alg/TimeDistribution/FindPaths.ts b/src/alg/TimeDistribution/FindPaths.ts similarity index 100% rename from alg/TimeDistribution/FindPaths.ts rename to src/alg/TimeDistribution/FindPaths.ts diff --git a/alg/TimeDistribution/Utils.ts b/src/alg/TimeDistribution/Utils.ts similarity index 100% rename from alg/TimeDistribution/Utils.ts rename to src/alg/TimeDistribution/Utils.ts diff --git a/api/travelModule.ts b/src/api/travelModule.ts similarity index 100% rename from api/travelModule.ts rename to src/api/travelModule.ts diff --git a/data/Items.ts b/src/data/Items.ts similarity index 100% rename from data/Items.ts rename to src/data/Items.ts diff --git a/data/Polls.ts b/src/data/Polls.ts similarity index 100% rename from data/Polls.ts rename to src/data/Polls.ts diff --git a/data/Projects.ts b/src/data/Projects.ts similarity index 87% rename from data/Projects.ts rename to src/data/Projects.ts index 09c9dfb..a301051 100644 --- a/data/Projects.ts +++ b/src/data/Projects.ts @@ -1,4 +1,4 @@ -import { Project } from "../test/data"; +import { Project } from "../../test/data"; const berlin: Project = { _id: "projectId1", diff --git a/data/Rooms.ts b/src/data/Rooms.ts similarity index 100% rename from data/Rooms.ts rename to src/data/Rooms.ts diff --git a/data/Students.ts b/src/data/Students.ts similarity index 100% rename from data/Students.ts rename to src/data/Students.ts diff --git a/index.ts b/src/index.ts similarity index 100% rename from index.ts rename to src/index.ts diff --git a/src/types/Group.ts b/src/types/Group.ts new file mode 100644 index 0000000..6fe1794 --- /dev/null +++ b/src/types/Group.ts @@ -0,0 +1,5 @@ +export interface Group { + id: number; + path: string[]; + studentIds: string[]; +} diff --git a/types/Item.ts b/src/types/Item.ts similarity index 100% rename from types/Item.ts rename to src/types/Item.ts diff --git a/types/Path.ts b/src/types/Path.ts similarity index 100% rename from types/Path.ts rename to src/types/Path.ts diff --git a/types/Polls.ts b/src/types/Polls.ts similarity index 100% rename from types/Polls.ts rename to src/types/Polls.ts diff --git a/types/Project.ts b/src/types/Project.ts similarity index 100% rename from types/Project.ts rename to src/types/Project.ts diff --git a/types/Room.ts b/src/types/Room.ts similarity index 100% rename from types/Room.ts rename to src/types/Room.ts diff --git a/types/Student.ts b/src/types/Student.ts similarity index 100% rename from types/Student.ts rename to src/types/Student.ts diff --git a/utils/array.ts b/src/utils/array.ts similarity index 100% rename from utils/array.ts rename to src/utils/array.ts diff --git a/test/Groups.test.ts b/test/Groups.test.ts index d8e729d..9675dd9 100644 --- a/test/Groups.test.ts +++ b/test/Groups.test.ts @@ -1,4 +1,4 @@ -import { Groups, Group } from "../Class/Groups"; +import { Groups, Group } from "../src/Class/Groups"; describe("Groups class", () => { let groups: Groups; diff --git a/test/data.ts b/test/data.ts index 7a6445f..d76a676 100644 --- a/test/data.ts +++ b/test/data.ts @@ -1,7 +1,7 @@ -import PollQuestion from "../types/Polls"; -import Student from "../types/Student"; -import Item from "../types/Item"; -import Project from "./../types/Project"; +import PollQuestion from "../src/types/Polls"; +import Student from "../src/types/Student"; +import Item from "../src/types/Item"; +import Project from "../src/types/Project"; const items: Item[] = [ { diff --git a/test/graph.test.ts b/test/graph.test.ts index 389372e..987aed7 100644 --- a/test/graph.test.ts +++ b/test/graph.test.ts @@ -1,4 +1,4 @@ -import { DirectedGraph, GraphNode } from "../Class/Graph"; // Replace with your actual file path +import { DirectedGraph } from "../src/Class/Graph"; // Replace with your actual file path describe("DirectedGraph", () => { it("should add nodes correctly", () => { diff --git a/test/pq.test.ts b/test/pq.test.ts index a7aa32d..2523f40 100644 --- a/test/pq.test.ts +++ b/test/pq.test.ts @@ -1,4 +1,4 @@ -import { PriorityQueue } from "../Class/PriorityQueue"; +import { PriorityQueue } from "../src/Class/PriorityQueue"; describe("PriorityQueue", () => { it("should enqueue elements with proper priority and dequeue in correct order", () => { diff --git a/test/timeDistribution.test.ts b/test/timeDistribution.test.ts index 4ad2bde..e236592 100644 --- a/test/timeDistribution.test.ts +++ b/test/timeDistribution.test.ts @@ -1,8 +1,9 @@ -import { getVotingIds, main } from "../alg/TimeDistribution"; +import { main } from "../src/alg/TimeDistribution"; import { findItemsByStudentId, getDefaultIds, -} from "../alg/TimeDistribution/Utils"; + getVotingIds, +} from "../src/alg/TimeDistribution/Utils"; import { items, polls, students, project } from "./data"; describe("Time Distribution Algorithm", () => { diff --git a/test/utils/array.test.ts b/test/utils/array.test.ts index 21e5a1c..9c3f9fc 100644 --- a/test/utils/array.test.ts +++ b/test/utils/array.test.ts @@ -1,4 +1,4 @@ -import { arraysHaveSameValues } from "../../utils/array"; +import { arraysHaveSameValues } from "../../src/utils/array"; describe("arraysHaveSameValues", () => { it("should return true for arrays with the same values", () => {