-
Notifications
You must be signed in to change notification settings - Fork 148
Closed
Description
Objective
Extract the sanitizeWorkflowName function from pkg/workflow/js/parse_firewall_logs.cjs to its own dedicated helper file.
Context
The sanitizeWorkflowName function in parse_firewall_logs.cjs is a utility that could be reused. Following the pattern of "1 javascript helper per file so that they can be imported one by one", this should be extracted to its own module. Part of issue #3119.
Approach
- Create new file:
pkg/workflow/js/sanitize_workflow_name.cjs - Move the
sanitizeWorkflowNamefunction to the new file - Export the function as a CommonJS module:
module.exports = { sanitizeWorkflowName }; - Update
pkg/workflow/js/parse_firewall_logs.cjsto import:const { sanitizeWorkflowName } = require('./sanitize_workflow_name.cjs'); - Remove the function definition from
parse_firewall_logs.cjs
Files to Modify
- Create:
pkg/workflow/js/sanitize_workflow_name.cjs(new helper file) - Update:
pkg/workflow/js/parse_firewall_logs.cjs(import and remove definition)
Acceptance Criteria
- New helper file
sanitize_workflow_name.cjscontains the function - Function is properly exported as CommonJS module
-
parse_firewall_logs.cjsimports from the new helper - Function definition removed from
parse_firewall_logs.cjs - Existing tests pass (no functionality broken)
- Code follows the pattern: 1 helper per file for granular imports
Related to [refactor] 🔧 Semantic Function Clustering Analysis: Refactoring Opportunities #3119
AI generated by Plan Command for #3119
Reactions are currently unavailable