diff --git a/index.js b/index.js index 0a131f4..233dd16 100644 --- a/index.js +++ b/index.js @@ -50,10 +50,10 @@ class Bumper extends Plugin { if (isDryRun) return noop; - const isJson = ['application/json', 'json'].includes(type) - const isYaml = ['text/yaml', 'application/x-yaml', 'yaml', 'yml'].includes(type) - const isToml = (type === 'toml') - const isIni = ['application/textedit', 'ini'].includes(type) + const isJson = ['application/json', 'json'].includes(type); + const isYaml = ['text/yaml', 'application/x-yaml', 'yaml', 'yml'].includes(type); + const isToml = type === 'toml'; + const isIni = ['application/textedit', 'ini'].includes(type); if (isJson) { const data = await readFile(file, 'utf8').catch(() => '{}'); diff --git a/test.js b/test.js index 09a4c65..ec71af4 100644 --- a/test.js +++ b/test.js @@ -12,9 +12,8 @@ mock({ './foo.php': '/* comments\nversion: v1.0.0 */ hello world

; ?>\n', './manifest.json': '{}', './dryrun.json': JSON.stringify({ version: '1.0.0' }), - './foo.toml': `[tool.test] -version = "1.0.0"`, - './foo.ini': `path.version=1.0.0\npath.name=fake`, + './foo.toml': '[tool.test]\nversion = "1.0.0"', + './foo.ini': `path.version=1.0.0\npath.name=fake` }); const namespace = 'bumper';