File tree Expand file tree Collapse file tree 1 file changed +11
-14
lines changed
Expand file tree Collapse file tree 1 file changed +11
-14
lines changed Original file line number Diff line number Diff line change 1- import { readFileSync , existsSync } from "fs" ;
1+ import { readFileSync } from "fs" ;
22
33import { safeLoad , safeDump } from "js-yaml" ;
44/* eslint-disable import/no-extraneous-dependencies */
@@ -18,20 +18,17 @@ const toYAML = function(object) {
1818} ;
1919
2020const loadYAMLFile = function ( configFile ) {
21- if ( existsSync ( configFile ) ) {
22- try {
23- const config = readFileSync ( configFile , "utf8" ) ;
24- const contents = safeLoad ( config , {
25- filename : configFile ,
26- onWarning : debug
27- } ) ;
28- return contents ;
29- } catch ( e ) {
30- debug ( e . message , e . name ) ;
31- return false ;
32- }
21+ try {
22+ const config = readFileSync ( configFile , "utf8" ) ;
23+ const contents = safeLoad ( config , {
24+ filename : configFile ,
25+ onWarning : debug
26+ } ) ;
27+ return contents ;
28+ } catch ( e ) {
29+ debug ( e . message , e . name ) ;
30+ return false ;
3331 }
34- return false ;
3532} ;
3633
3734export { toYAML , loadYAMLFile } ;
You can’t perform that action at this time.
0 commit comments