summaryrefslogtreecommitdiff
path: root/src/sources/FileSource.ts
diff options
context:
space:
mode:
authorschneefux <schneefux+commit@schneefux.xyz>2018-05-02 09:15:09 +0200
committerschneefux <schneefux+commit@schneefux.xyz>2018-05-02 09:15:09 +0200
commit5cb003e51b7388a6acc50b8fd9acb0c69c119eb4 (patch)
treeda07bfcdcf8bd1baf29cdf4d6d080614692b7385 /src/sources/FileSource.ts
parent567a0f7a2f248cd25b8a5e0e357f9b10c16a9036 (diff)
downloadsplus-5cb003e51b7388a6acc50b8fd9acb0c69c119eb4.tar.gz
splus-5cb003e51b7388a6acc50b8fd9acb0c69c119eb4.zip
rm ISource & FileSource, combine request & parsing, split filter from parser
Diffstat (limited to 'src/sources/FileSource.ts')
-rw-r--r--src/sources/FileSource.ts26
1 files changed, 0 insertions, 26 deletions
diff --git a/src/sources/FileSource.ts b/src/sources/FileSource.ts
deleted file mode 100644
index 57e51ae..0000000
--- a/src/sources/FileSource.ts
+++ /dev/null
@@ -1,26 +0,0 @@
-import {readFile} from 'fs';
-
-import {ISource} from './ISource';
-
-export class FileSource implements ISource {
- private _path: string;
- private _data: string = null;
-
- constructor(course: string) {
- }
-
- getData(weekOfYear: number): Promise<string> {
- if (this._data) {
- return Promise.resolve(this._data);
- }
-
- return new Promise<string>((resolve, reject) => {
- readFile(this._path, (err, data) => {
- if (err) return reject(err);
-
- this._data = data.toString();
- resolve(this._data);
- });
- });
- }
-}