Skip to content

Commit d4c6d1b

Browse files
committed
refactor(node)!: Reduce visibility of NodeManagerType details
The visibility of the class cannot be `internal`, because of the public exposure via the respective node package manager constructors. So, reduce the visibility of functions and properties to hide implementation details. Signed-off-by: Frank Viernau <[email protected]>
1 parent f460b60 commit d4c6d1b

File tree

1 file changed

+7
-7
lines changed

1 file changed

+7
-7
lines changed

plugins/package-managers/node/src/main/kotlin/NodePackageManagerType.kt

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -30,10 +30,10 @@ import org.ossreviewtoolkit.utils.common.collectMessages
3030
* An enum of all supported Node package managers.
3131
*/
3232
enum class NodePackageManagerType(
33-
val projectType: String,
34-
val lockfileName: String,
35-
val markerFileName: String? = null,
36-
val workspaceFileName: String = NodePackageManagerType.DEFINITION_FILE
33+
internal val projectType: String,
34+
internal val lockfileName: String,
35+
internal val markerFileName: String? = null,
36+
internal val workspaceFileName: String = NodePackageManagerType.DEFINITION_FILE
3737
) {
3838
NPM(
3939
projectType = "NPM",
@@ -126,13 +126,13 @@ enum class NodePackageManagerType(
126126
/**
127127
* Return true if the [projectDir] contains a lockfile for this package manager, or return false otherwise.
128128
*/
129-
open fun hasLockfile(projectDir: File): Boolean = hasNonEmptyFile(projectDir, lockfileName)
129+
internal open fun hasLockfile(projectDir: File): Boolean = hasNonEmptyFile(projectDir, lockfileName)
130130

131131
/**
132132
* If the [projectDir] contains a workspace file for this package manager, return the list of package patterns, or
133133
* return null otherwise.
134134
*/
135-
open fun getWorkspaces(projectDir: File): List<String>? {
135+
internal open fun getWorkspaces(projectDir: File): List<String>? {
136136
val workspaceFile = projectDir.resolve(workspaceFileName)
137137
if (!workspaceFile.isFile) return null
138138

@@ -163,7 +163,7 @@ enum class NodePackageManagerType(
163163
* Return a score for the [projectDir] based on the presence of files specific to this package manager.
164164
* The higher the score, the more likely it is that the [projectDir] is managed by this package manager.
165165
*/
166-
fun getFileScore(projectDir: File): Int =
166+
internal fun getFileScore(projectDir: File): Int =
167167
listOf(
168168
hasLockfile(projectDir),
169169
hasNonEmptyFile(projectDir, markerFileName),

0 commit comments

Comments
 (0)