Skip to content

Commit

Permalink
chore(node): Make a function an expression
Browse files Browse the repository at this point in the history
Shorten code a bit.

Signed-off-by: Sebastian Schuberth <sebastian@doubleopen.org>
  • Loading branch information
sschuberth committed Jun 6, 2024
1 parent 882907a commit 117609e
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions plugins/package-managers/node/src/main/kotlin/Yarn2.kt
Original file line number Diff line number Diff line change
Expand Up @@ -149,11 +149,10 @@ class Yarn2(
* Check whether Corepack is enabled based on the `package.json` file in [workingDir]. If no such file is found
* or if it cannot be read, assume that this is not the case.
*/
private fun isCorepackEnabledInManifest(workingDir: File): Boolean {
return runCatching {
private fun isCorepackEnabledInManifest(workingDir: File): Boolean =
runCatching {
jsonMapper.readTree(workingDir.resolve(MANIFEST_FILE)).contains(PACKAGE_MANAGER_PROPERTY)
}.getOrDefault(false)
}
}

class Factory : AbstractPackageManagerFactory<Yarn2>("Yarn2") {
Expand Down

0 comments on commit 117609e

Please sign in to comment.