Skip to content
This repository has been archived by the owner on Aug 22, 2023. It is now read-only.

Commit

Permalink
perf: use fs instead of load-json-file
Browse files Browse the repository at this point in the history
  • Loading branch information
jdx committed Feb 7, 2018
1 parent 34ada72 commit 7091b4d
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/util.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,9 @@ export function mapValues<T extends object, TResult>(obj: {[P in keyof T]: T[P]}
}

export function loadJSONSync(path: string): any {
let loadJSON
try { loadJSON = require('load-json-file') } catch {}
if (loadJSON) return loadJSON.sync(path)
// let loadJSON
// try { loadJSON = require('load-json-file') } catch {}
// if (loadJSON) return loadJSON.sync(path)
return JSON.parse(fs.readFileSync(path, 'utf8'))
}

Expand Down

0 comments on commit 7091b4d

Please sign in to comment.