Avoid export default

This commit is contained in:
Aya Morisawa
2019-01-30 16:56:27 +09:00
parent 1c60a49c96
commit 28bfb45426
18 changed files with 26 additions and 28 deletions

View File

@@ -1,19 +1,19 @@
import parser from './parser';
import { mfmLanguage } from './parser';
import { MfmForest } from './types';
import { normalize } from './normalize';
export default (source: string): MfmForest => {
export function parse(source: string): MfmForest {
if (source == null || source == '') {
return null;
}
return normalize(parser.root.tryParse(source));
};
return normalize(mfmLanguage.root.tryParse(source));
}
export function parsePlain(source: string): MfmForest {
if (source == null || source == '') {
return null;
}
return normalize(parser.plain.tryParse(source));
return normalize(mfmLanguage.plain.tryParse(source));
}