From 6561634c687cad2d1b7041b45b618d1c336f2e68 Mon Sep 17 00:00:00 2001 From: Aleksey Kladov Date: Tue, 31 Dec 2019 02:21:57 +0100 Subject: Remove trivial helpers --- editors/code/src/scopes.ts | 18 +++--------------- 1 file changed, 3 insertions(+), 15 deletions(-) (limited to 'editors') diff --git a/editors/code/src/scopes.ts b/editors/code/src/scopes.ts index cb250b853..465556333 100644 --- a/editors/code/src/scopes.ts +++ b/editors/code/src/scopes.ts @@ -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); -} -- cgit v1.2.3