Browse files

Don't allow non-string description fields

  • Loading branch information...
1 parent 0042585 commit 1a3cdca3641a553236c504d81ca33945d73f50a9 @isaacs isaacs committed Sep 8, 2012
Showing with 7 additions and 0 deletions.
  1. +7 −0 read-json.js
View
7 read-json.js
@@ -300,6 +300,13 @@ function final (file, data, cb) {
unParsePeople(file, data)
parsePeople(file, data)
+ if (data.description &&
+ typeof data.description !== 'string') {
+ warn(file, data,
+ "'description' field should be a string")
+ delete data.description
+ }
+
if (data.readme && !data.description)
readmeDescription(file, data)

0 comments on commit 1a3cdca

Please sign in to comment.