Open pkaminski opened 8 years ago
I think this is a "bug" in the bower-config of serialized-lru-cache
. This type of license definition is not in the spec. This issue should be fixed there and not here.
Thanks anyway for finding and reporting!
I agree, I don't think the library should be parsing arbitrary specs, but the crashing is not good.
I think what makes sense is simply to check for type:
if (typeof bowerData.license === 'string'){
moduleInfo.licenses = moduleInfo.licenses.concat(bowerData.license)
}
OK, I opened a PR against serialized-lru-cache: https://github.com/jmendiara/serialized-lru-cache/pull/1
FWIW, the spec you pointed to also allows an array of strings for the license
value, so the type check should probably allow for that.
Fixed in https://github.com/jmendiara/serialized-lru-cache/pull/1 @badunk Can be closed here!
I found at least one Bower package (
serialized-lru-cache
) that defines its license as:No idea if it's spec-compliant or not, but it will crash
bower-license
and it's a simple fix, so...This change is