When a package has an empty string ('') as its description, the } else if (doc.name && doc.description) { check fails, because empty strings are falsey.
This means that data from the npm registry is returned uncleaned. In particular, the behavior that caused me to notice this is a package where the versions field was returned as an object instead of an array like all the other packages.
When a package has an empty string (
''
) as its description, the} else if (doc.name && doc.description) {
check fails, because empty strings are falsey.https://github.com/nice-registry/nice-package/blob/3dab613e9c43a57ddedcc0b68ccbe6e3400d8769/lib/clean.js#L21
This means that data from the npm registry is returned uncleaned. In particular, the behavior that caused me to notice this is a package where the
versions
field was returned as an object instead of an array like all the other packages.