Skip to content

Commit 35286b9

Browse files
committed
Fixes empty yarnrc files
1 parent 4d6f909 commit 35286b9

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

src/lockfile/parse.js

+6-1
Original file line numberDiff line numberDiff line change
@@ -398,9 +398,14 @@ function parse(str: string, fileLoc: string): Object {
398398
}
399399
}
400400
} else {
401-
return safeLoad(str, {
401+
const result = safeLoad(str, {
402402
schema: FAILSAFE_SCHEMA,
403403
});
404+
if (typeof result === 'object') {
405+
return result;
406+
} else {
407+
return {};
408+
}
404409
}
405410
}
406411

0 commit comments

Comments
 (0)