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 2.1.1 to 3.0.0

2

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

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

@@ -9,3 +9,3 @@ const { parseFileHeaders } = require('./line_parser')

// and validate those.
const parseAllHeaders = async function ({ headersFiles = [], netlifyConfigPath, configHeaders = [] } = {}) {
const parseAllHeaders = async function ({ headersFiles = [], netlifyConfigPath, configHeaders = [] }) {
const [

@@ -12,0 +12,0 @@ { headers: fileHeaders, errors: fileParseErrors },

const { parseAllHeaders } = require('./all')
const { parseFileHeaders } = require('./line_parser')
const { mergeHeaders } = require('./merge')
const { parseConfigHeaders } = require('./netlify_config_parser')
const { normalizeHeaders } = require('./normalize')
module.exports = {
parseAllHeaders,
parseFileHeaders,
mergeHeaders,
parseConfigHeaders,
normalizeHeaders,
}
module.exports = { parseAllHeaders }

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

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

@@ -19,4 +19,4 @@ const { splitResults } = require('./results')

// as `netlify.toml` headers.
const mergeHeaders = function ({ fileHeaders = [], configHeaders = [] }) {
const results = [...validateArray(fileHeaders), ...validateArray(configHeaders)]
const mergeHeaders = function ({ fileHeaders, configHeaders }) {
const results = [...fileHeaders, ...configHeaders]
const { headers, errors } = splitResults(results)

@@ -27,8 +27,2 @@ const mergedHeaders = headers.filter(isUniqueHeader)

const validateArray = function (headers) {
return Array.isArray(headers)
? headers
: [new TypeError(`Headers should be an array: ${inspect(headers, { colors: false })}`)]
}
// Remove duplicates. This is especially likely considering `fileHeaders` might

@@ -35,0 +29,0 @@ // have been previously merged to `configHeaders`, which happens when

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