extract the parser api to a base class
[rss-reader.git] / src / parsers / rss.ts
index d23dcc2327b0c348dd0c605d2c58dd55e04a4754..e2db58d7ef130576cd42efd7073fb2f937c9db9a 100644 (file)
@@ -1,5 +1,5 @@
 import Parser from 'rss-parser';
-import {Feed} from './base';
+import {Feed, BaseParser} from './base';
 
 function timestamp(str: string): number {
   const date = +(new Date(str));
@@ -13,9 +13,10 @@ function reasonable(dateStr: string): string {
   return `${date.getFullYear()}-${month}-${day}`;
 }
 
-export class RSSParser {
+export class RSSParser extends BaseParser {
   parser: Parser;
   constructor() {
+    super();
     this.parser = new Parser;
   }