Skip to content

Commit

Permalink
fix(pnpm): Tolerate absent name / version in projects' package.json
Browse files Browse the repository at this point in the history
The name and version fields may be absent for projects, while they are
not absent for (published) dependencies. Specify a default value to
avoid running into an exception during deserialization.

Fixes #9461.

Signed-off-by: Frank Viernau <[email protected]>
  • Loading branch information
fviernau committed Nov 19, 2024
1 parent 212d1a1 commit 37dae9f
Showing 1 changed file with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -28,8 +28,8 @@ internal fun parsePnpmList(json: String): List<ModuleInfo> = JSON.decodeFromStri

@Serializable
internal data class ModuleInfo(
val name: String,
val version: String,
val name: String? = null,
val version: String? = null,
val path: String,
val private: Boolean,
val dependencies: Map<String, Dependency> = emptyMap(),
Expand Down

0 comments on commit 37dae9f

Please sign in to comment.