netlify-headers-parser
Advanced tools
Comparing version 2.0.0 to 2.1.0
{ | ||
"name": "netlify-headers-parser", | ||
"version": "2.0.0", | ||
"version": "2.1.0", | ||
"description": "Parses Netlify headers into a JavaScript object representation", | ||
@@ -5,0 +5,0 @@ "main": "src/index.js", |
@@ -9,10 +9,14 @@ const { parseFileHeaders } = require('./line_parser') | ||
// and validate those. | ||
const parseAllHeaders = async function ({ headersFiles = [], netlifyConfigPath } = {}) { | ||
const [{ headers: fileHeaders, errors: fileParseErrors }, { headers: configHeaders, errors: configParseErrors }] = | ||
await Promise.all([getFileHeaders(headersFiles), getConfigHeaders(netlifyConfigPath)]) | ||
const parseAllHeaders = async function ({ headersFiles = [], netlifyConfigPath, configHeaders = [] } = {}) { | ||
const [ | ||
{ headers: fileHeaders, errors: fileParseErrors }, | ||
{ headers: parsedConfigHeaders, errors: configParseErrors }, | ||
] = await Promise.all([getFileHeaders(headersFiles), getConfigHeaders(netlifyConfigPath)]) | ||
const { headers: normalizedFileHeaders, errors: fileNormalizeErrors } = normalizeHeaders(fileHeaders) | ||
const { headers: normalizedConfigParseHeaders, errors: configParseNormalizeErrors } = | ||
normalizeHeaders(parsedConfigHeaders) | ||
const { headers: normalizedConfigHeaders, errors: configNormalizeErrors } = normalizeHeaders(configHeaders) | ||
const { headers, errors: mergeErrors } = mergeHeaders({ | ||
fileHeaders: normalizedFileHeaders, | ||
configHeaders: normalizedConfigHeaders, | ||
configHeaders: [...normalizedConfigParseHeaders, ...normalizedConfigHeaders], | ||
}) | ||
@@ -23,2 +27,3 @@ const errors = [ | ||
...configParseErrors, | ||
...configParseNormalizeErrors, | ||
...configNormalizeErrors, | ||
@@ -25,0 +30,0 @@ ...mergeErrors, |
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
16214
324