Comparing version 5.0.0 to 5.0.1
@@ -32,3 +32,4 @@ /** | ||
if (allDescriptors.x['1']) { | ||
// TODO: Use `?`. | ||
if (allDescriptors.x && allDescriptors.x['1']) { | ||
throw new Error('A fallback image is equivalent to a 1x descriptor, providing both is invalid.'); | ||
@@ -85,3 +86,6 @@ } | ||
return string.split(imageCandidateRegex) | ||
return string | ||
.replace(/\r?\n/, '') | ||
.replace(/,\s+/, ', ') | ||
.split(imageCandidateRegex) | ||
.filter((part, index) => index % 2 === 1) | ||
@@ -88,0 +92,0 @@ .map(part => { |
{ | ||
"name": "srcset", | ||
"version": "5.0.0", | ||
"version": "5.0.1", | ||
"description": "Parse and stringify the HTML `<img>` srcset attribute", | ||
@@ -15,2 +15,4 @@ "license": "MIT", | ||
"exports": "./index.js", | ||
"types": "./index.d.ts", | ||
"sideEffects": false, | ||
"engines": { | ||
@@ -20,3 +22,4 @@ "node": "^12.20.0 || ^14.13.1 || >=16.0.0" | ||
"scripts": { | ||
"test": "xo && ava && tsd" | ||
"//test": "xo && ava && tsd", | ||
"test": "ava && tsd" | ||
}, | ||
@@ -23,0 +26,0 @@ "files": [ |
@@ -102,13 +102,1 @@ # srcset | ||
Enable or disable validation of the `SrcSetDefinition`'s. When true, invalid input will cause an error to be thrown. When false, a best effort will be made to stringify invalid input, likely resulting in invalid srcset value. | ||
--- | ||
<div align="center"> | ||
<b> | ||
<a href="https://tidelift.com/subscription/pkg/npm-srcset?utm_source=npm-srcset&utm_medium=referral&utm_campaign=readme">Get professional support for this package with a Tidelift subscription</a> | ||
</b> | ||
<br> | ||
<sub> | ||
Tidelift helps make open source sustainable for maintainers while giving companies<br>assurances about security, maintenance, and licensing for their dependencies. | ||
</sub> | ||
</div> |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
202
10558
102