|
|
@@ -1,6 +1,7 @@
|
|
|
-import markdownTable from 'markdown-table';
|
|
|
import stringWidth from 'string-width';
|
|
|
|
|
|
+import MarkdownTable from '../../models/MarkdownTable';
|
|
|
+
|
|
|
/**
|
|
|
* Utility for markdown table
|
|
|
*/
|
|
|
@@ -185,24 +186,6 @@ class MarkdownTableUtil {
|
|
|
}
|
|
|
}
|
|
|
|
|
|
-/**
|
|
|
- * markdown table class for markdown-table module
|
|
|
- * ref. https://github.com/wooorm/markdown-table
|
|
|
- */
|
|
|
-class MarkdownTable {
|
|
|
-
|
|
|
- constructor(table, options) {
|
|
|
- this.table = table || [];
|
|
|
- this.options = options || {};
|
|
|
-
|
|
|
- this.toString = this.toString.bind(this);
|
|
|
- }
|
|
|
-
|
|
|
- toString() {
|
|
|
- return markdownTable(this.table, this.options);
|
|
|
- }
|
|
|
-}
|
|
|
-
|
|
|
// singleton pattern
|
|
|
const instance = new MarkdownTableUtil();
|
|
|
Object.freeze(instance);
|