Skip to content

Commit

Permalink
refactor: add instead of delete
Browse files Browse the repository at this point in the history
  • Loading branch information
Skn0tt committed Jan 6, 2023
1 parent cc1aa18 commit 699a053
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions node/manifest.ts
Original file line number Diff line number Diff line change
Expand Up @@ -50,11 +50,11 @@ interface Route {
const serializePattern = (regex: RegExp) => regex.source.replace(/\\\//g, '/')

const sanitizeEdgeFunctionConfig = (config: Record<string, EdgeFunctionConfig>): Record<string, EdgeFunctionConfig> => {
const newConfig = { ...config }
const newConfig: Record<string, EdgeFunctionConfig> = {}

for (const [name, functionConfig] of Object.entries(newConfig)) {
if (functionConfig.excluded_patterns.length === 0) {
delete newConfig[name]
for (const [name, functionConfig] of Object.entries(config)) {
if (functionConfig.excluded_patterns.length !== 0) {
newConfig[name] = functionConfig
}
}

Expand Down

0 comments on commit 699a053

Please sign in to comment.