Remove trivial helpers

This commit is contained in:
Aleksey Kladov 2019-12-31 02:21:57 +01:00
parent 8346bdc04d
commit 6561634c68

View file

@ -82,9 +82,9 @@ function loadThemeNamed(themeName: string) {
function loadThemeFile(themePath: string) {
const themeContent = [themePath]
.filter(isFile)
.map(readFileText)
.map(parseJSON)
.filter(it => fs.statSync(it).isFile())
.map(it => fs.readFileSync(it, 'utf8'))
.map(it => jsonc.parse(it))
.filter(theme => theme);
themeContent
@ -132,15 +132,3 @@ function loadColors(textMateRules: TextMateRule[]): void {
}
});
}
function isFile(filePath: string): boolean {
return [filePath].map(fs.statSync).every(stat => stat.isFile());
}
function readFileText(filePath: string): string {
return fs.readFileSync(filePath, 'utf8');
}
function parseJSON(content: string): any {
return jsonc.parse(content);
}