MCPcopy Create free account
hub / github.com/angular/dev-infra / loadWorkflows

Function loadWorkflows

ng-dev/perf/workflow/loader.ts:17–33  ·  view source on GitHub ↗
(src: string)

Source from the content-addressed store, hash-verified

15}
16
17export async function loadWorkflows(src: string) {
18 /** The set of workflows which can be executed. */
19 const filteredWorkflows: {[key: string]: Workflow} = {};
20 /** The workflow configuration file content as a string. */
21 const rawWorkflows = await readFile(src, {encoding: 'utf-8'});
22 /** The object parsed from the workflow configuration file, holding the workflow configurations. */
23 const workflows = parse(rawWorkflows).workflows as {[key: string]: Workflow};
24
25 // Remove any workflow which is marked as disabled.
26 for (const [name, workflow] of Object.entries(workflows)) {
27 if (workflow.disabled !== true) {
28 filteredWorkflows[name] = workflow;
29 }
30 }
31
32 return filteredWorkflows;
33}

Callers 1

handlerFunction · 0.85

Calls 2

parseFunction · 0.50
entriesMethod · 0.45

Tested by

no test coverage detected