Skip to content

Commit

Permalink
fix(plugin-version): Correctly check void releases for a null value
Browse files Browse the repository at this point in the history
js-yaml implements the YAML spec and it has no undefined type:

- nodeca/js-yaml#356 (comment)

I.e.:

```
> require('js-yaml').safeLoad('releases:\n')
{ releases: null }
```
  • Loading branch information
martinjlowm committed Jul 1, 2020
1 parent 5a19b1f commit e691b5b
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion packages/plugin-version/sources/versionUtils.ts
Expand Up @@ -174,7 +174,7 @@ export async function updateVersionFiles(project: Project) {
const versionContent = await xfs.readFilePromise(versionPath, `utf8`);
const versionData = parseSyml(versionContent);

if (typeof versionData.releases === `undefined`)
if (versionData.releases === null)
continue;

for (const locatorStr of Object.keys(versionData.releases || {})) {
Expand Down

0 comments on commit e691b5b

Please sign in to comment.