Socket
Socket
Sign inDemoInstall

srcset

Package Overview
Dependencies
Maintainers
1
Versions
10
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

srcset - npm Package Compare versions

Comparing version 5.0.0 to 5.0.1

8

index.js

@@ -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>
SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc