Skip to content
This repository has been archived by the owner on Jun 27, 2020. It is now read-only.

JsonSlurper fails on empty package.json files #150

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,7 @@ open class NpmIndexTask : DefaultTask() {
}

private fun packageJsonContainsTypes(file: File): Boolean {
if (file.length == 0) return false
val parsedFile = JsonSlurper().parse(file)
return (parsedFile is Map<*, *> && parsedFile["typings"] != null)
}
Expand All @@ -81,4 +82,4 @@ open class NpmIndexTask : DefaultTask() {

return true
}
}
}