Fix [npm] badges when a dependency points to a URL (#2525)

Fix #2523
This commit is contained in:
Paul Melnikow
2018-12-13 14:07:33 -05:00
committed by GitHub
parent ec35e8de06
commit 5e50b7bcc4

View File

@@ -10,7 +10,15 @@ const deprecatedLicenseObjectSchema = Joi.object({
type: Joi.string().required(),
})
const dependencyMap = Joi.object()
.pattern(/./, semverRange)
.pattern(
/./,
Joi.alternatives().try(
semverRange,
Joi.string()
.uri()
.required()
)
)
.default({})
const schema = Joi.object({
dependencies: dependencyMap,