Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Don't allow non-string description fields

  • Loading branch information...
commit 1a3cdca3641a553236c504d81ca33945d73f50a9 1 parent 0042585
@isaacs isaacs authored
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)
Please sign in to comment.
Something went wrong with that request. Please try again.