@netlify/config
Advanced tools
Comparing version 20.3.3 to 20.3.4
@@ -20,5 +20,2 @@ import { getApiClient } from './api/client.js'; | ||
import { getRedirectsPath, addRedirects } from './redirects.js'; | ||
export { DEV_EVENTS, EVENTS } from './events.js'; | ||
export { cleanupConfig } from './log/cleanup.js'; | ||
export { updateConfig, restoreConfig } from './mutations/update.js'; | ||
// Load the configuration file. | ||
@@ -25,0 +22,0 @@ // Takes an optional configuration file path as input and return the resolved |
@@ -1,14 +0,13 @@ | ||
// Retrieve normalized property name | ||
/** Properties with dynamic children */ | ||
const DYNAMIC_OBJECT_PROPS = new Set(['build.services', 'build.environment', 'functions', 'functions.*']); | ||
/** Retrieve normalized property name */ | ||
export const getPropName = function (keys) { | ||
return keys.reduce(normalizeDynamicProp, ''); | ||
// Some properties are user-defined, i.e. we need to replace them with a "*" token | ||
// Check if a property name is dynamic, such as `functions.{functionName}`, or | ||
// is an array index. | ||
// In those cases, we replace it by "*". | ||
return keys.reduce((propName, key) => { | ||
const normalizedKey = Number.isInteger(key) || DYNAMIC_OBJECT_PROPS.has(propName) ? '*' : String(key); | ||
return propName === '' ? normalizedKey : `${propName}.${normalizedKey}`; | ||
}, ''); | ||
}; | ||
// Some properties are user-defined, i.e. we need to replace them with a "*" token | ||
// Check if a property name is dynamic, such as `functions.{functionName}`, or | ||
// is an array index. | ||
// In those cases, we replace it by "*". | ||
const normalizeDynamicProp = function (propName, key) { | ||
const normalizedKey = Number.isInteger(key) || DYNAMIC_OBJECT_PROPS.has(propName) ? '*' : String(key); | ||
return propName === '' ? normalizedKey : `${propName}.${normalizedKey}`; | ||
}; | ||
// Properties with dynamic children | ||
const DYNAMIC_OBJECT_PROPS = new Set(['build.services', 'build.environment', 'functions', 'functions.*']); |
{ | ||
"name": "@netlify/config", | ||
"version": "20.3.3", | ||
"version": "20.3.4", | ||
"description": "Netlify config module", | ||
"type": "module", | ||
"exports": "./lib/main.js", | ||
"main": "./lib/main.js", | ||
"types": "./lib/main.d.ts", | ||
"exports": "./lib/index.js", | ||
"main": "./lib/index.js", | ||
"types": "./lib/index.d.ts", | ||
"bin": { | ||
@@ -85,3 +85,3 @@ "netlify-config": "./bin.js" | ||
"devDependencies": { | ||
"@types/node": "^14.18.31", | ||
"@types/node": "^18.14.2", | ||
"ava": "^4.0.0", | ||
@@ -98,3 +98,3 @@ "c8": "^7.12.0", | ||
}, | ||
"gitHead": "d78a65c209ed987d3475cd1f37cf357693b99e3c" | ||
"gitHead": "28a5471ea9834e4a137692213db2e510f74ef535" | ||
} |
126013
60
2736