Skip to content

Commit

Permalink
JS: Handle packages without a name
Browse files Browse the repository at this point in the history
  • Loading branch information
greysteil committed May 9, 2019
1 parent edd6fe3 commit 2864404
Showing 1 changed file with 1 addition and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -489,7 +489,7 @@ def sanitized_package_json_content(content)
gsub(%r{^\s*//.*}, " ") # comments are not allowed

json = JSON.parse(updated_content)
json["name"] = json["name"].delete(" ")
json["name"] = json["name"].delete(" ") if json["name"].is_a?(String)
json.to_json
end

Expand Down

0 comments on commit 2864404

Please sign in to comment.