From 16e0a1ae22ce074d5c52bc427439c75d0e9454c5 Mon Sep 17 00:00:00 2001 From: Natty Date: Sun, 9 Jul 2023 23:05:13 +0200 Subject: [PATCH] Removed dead code --- packages/backend/src/prelude/symbol.ts | 1 - .../src/services/chart/charts/test-grouped.ts | 41 ------------------ .../chart/charts/test-intersection.ts | 33 -------------- .../src/services/chart/charts/test-unique.ts | 27 ------------ .../backend/src/services/chart/charts/test.ts | 43 ------------------- 5 files changed, 145 deletions(-) delete mode 100644 packages/backend/src/prelude/symbol.ts delete mode 100644 packages/backend/src/services/chart/charts/test-grouped.ts delete mode 100644 packages/backend/src/services/chart/charts/test-intersection.ts delete mode 100644 packages/backend/src/services/chart/charts/test-unique.ts delete mode 100644 packages/backend/src/services/chart/charts/test.ts diff --git a/packages/backend/src/prelude/symbol.ts b/packages/backend/src/prelude/symbol.ts deleted file mode 100644 index 5b88467d46..0000000000 --- a/packages/backend/src/prelude/symbol.ts +++ /dev/null @@ -1 +0,0 @@ -export const fallback = Symbol("fallback"); diff --git a/packages/backend/src/services/chart/charts/test-grouped.ts b/packages/backend/src/services/chart/charts/test-grouped.ts deleted file mode 100644 index 6520099fe6..0000000000 --- a/packages/backend/src/services/chart/charts/test-grouped.ts +++ /dev/null @@ -1,41 +0,0 @@ -import type { KVs } from "../core.js"; -import Chart from "../core.js"; -import { name, schema } from "./entities/test-grouped.js"; - -/** - * For testing - */ - -export default class TestGroupedChart extends Chart { - private total = {} as Record; - - constructor() { - super(name, schema, true); - } - - protected async tickMajor( - group: string, - ): Promise>> { - return { - "foo.total": this.total[group], - }; - } - - protected async tickMinor(): Promise>> { - return {}; - } - - public async increment(group: string): Promise { - if (this.total[group] == null) this.total[group] = 0; - - this.total[group]++; - - await this.commit( - { - "foo.total": 1, - "foo.inc": 1, - }, - group, - ); - } -} diff --git a/packages/backend/src/services/chart/charts/test-intersection.ts b/packages/backend/src/services/chart/charts/test-intersection.ts deleted file mode 100644 index 0fa973861f..0000000000 --- a/packages/backend/src/services/chart/charts/test-intersection.ts +++ /dev/null @@ -1,33 +0,0 @@ -import type { KVs } from "../core.js"; -import Chart from "../core.js"; -import { name, schema } from "./entities/test-intersection.js"; - -/** - * For testing - */ - -export default class TestIntersectionChart extends Chart { - constructor() { - super(name, schema); - } - - protected async tickMajor(): Promise>> { - return {}; - } - - protected async tickMinor(): Promise>> { - return {}; - } - - public async addA(key: string): Promise { - await this.commit({ - a: [key], - }); - } - - public async addB(key: string): Promise { - await this.commit({ - b: [key], - }); - } -} diff --git a/packages/backend/src/services/chart/charts/test-unique.ts b/packages/backend/src/services/chart/charts/test-unique.ts deleted file mode 100644 index 095021622c..0000000000 --- a/packages/backend/src/services/chart/charts/test-unique.ts +++ /dev/null @@ -1,27 +0,0 @@ -import type { KVs } from "../core.js"; -import Chart from "../core.js"; -import { name, schema } from "./entities/test-unique.js"; - -/** - * For testing - */ - -export default class TestUniqueChart extends Chart { - constructor() { - super(name, schema); - } - - protected async tickMajor(): Promise>> { - return {}; - } - - protected async tickMinor(): Promise>> { - return {}; - } - - public async uniqueIncrement(key: string): Promise { - await this.commit({ - foo: [key], - }); - } -} diff --git a/packages/backend/src/services/chart/charts/test.ts b/packages/backend/src/services/chart/charts/test.ts deleted file mode 100644 index afdb3bf14e..0000000000 --- a/packages/backend/src/services/chart/charts/test.ts +++ /dev/null @@ -1,43 +0,0 @@ -import type { KVs } from "../core.js"; -import Chart from "../core.js"; -import { name, schema } from "./entities/test.js"; - -/** - * For testing - */ - -export default class TestChart extends Chart { - public total = 0; // publicにするのはテストのため - - constructor() { - super(name, schema); - } - - protected async tickMajor(): Promise>> { - return { - "foo.total": this.total, - }; - } - - protected async tickMinor(): Promise>> { - return {}; - } - - public async increment(): Promise { - this.total++; - - await this.commit({ - "foo.total": 1, - "foo.inc": 1, - }); - } - - public async decrement(): Promise { - this.total--; - - await this.commit({ - "foo.total": -1, - "foo.dec": 1, - }); - } -}