Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

netlify-headers-parser

Package Overview
Dependencies
Maintainers
1
Versions
25
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

netlify-headers-parser - npm Package Compare versions

Comparing version 1.0.1 to 1.1.0

2

package.json
{
"name": "netlify-headers-parser",
"version": "1.0.1",
"version": "1.1.0",
"description": "Parses Netlify headers into a JavaScript object representation",

@@ -5,0 +5,0 @@ "main": "src/index.js",

@@ -1,2 +0,2 @@

const { inspect } = require('util')
const { inspect, isDeepStrictEqual } = require('util')

@@ -20,3 +20,3 @@ // Merge headers from `_headers` with the ones from `netlify.toml`.

validateArray(configHeaders)
return [...fileHeaders, ...configHeaders]
return [...fileHeaders, ...configHeaders].filter(isUniqueHeader)
}

@@ -30,2 +30,10 @@

// Remove duplicates. This is especially likely considering `fileHeaders` might
// have been previously merged to `configHeaders`, which happens when
// `netlifyConfig.headers` is modified by plugins.
// The latest duplicate value is the one kept.
const isUniqueHeader = function (header, index, headers) {
return !headers.slice(index + 1).some((otherHeader) => isDeepStrictEqual(header, otherHeader))
}
module.exports = { mergeHeaders }
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