From 136ab5d3cac6b1b19ab9d491d8f8845a2366d392 Mon Sep 17 00:00:00 2001 From: Jessie Wei Date: Fri, 7 Jun 2024 17:52:55 +1000 Subject: [PATCH] chore: Remove commented code --- .../src/utils/convertToDocx/getThreats.ts | 41 ------------------- 1 file changed, 41 deletions(-) diff --git a/packages/threat-composer-app/src/utils/convertToDocx/getThreats.ts b/packages/threat-composer-app/src/utils/convertToDocx/getThreats.ts index c9149f86..4c23727c 100644 --- a/packages/threat-composer-app/src/utils/convertToDocx/getThreats.ts +++ b/packages/threat-composer-app/src/utils/convertToDocx/getThreats.ts @@ -128,47 +128,6 @@ const getThreats = async ( children.push(table); return children; - // const rows: string[] = []; - // rows.push('## Threats'); - - // rows.push('\n'); - - // rows.push(`| Threat Number | Threat | ${threatsOnly ? '' : 'Mitigations | Assumptions |'} Priority | STRIDE | Comments |`); - // rows.push(`| --- | --- | ${threatsOnly ? '' : '--- | --- |'} --- | --- | --- |`); - - // if (data.threats) { - // const promises = data.threats.map(async (x) => { - // const mitigationLinks = data.mitigationLinks?.filter(ml => ml.linkedId === x.id) || []; - // const assumpptionLinks = data.assumptionLinks?.filter(al => al.linkedId === x.id) || []; - // const threatId = `T-${standardizeNumericId(x.numericId)}`; - // const assumptionsContent = assumpptionLinks.map(al => { - // const assumption = data.assumptions?.find(a => a.id === al.assumptionId); - // if (assumption) { - // const assumptionId = `A-${standardizeNumericId(assumption.numericId)}`; - // return `[**${assumptionId}**](#${assumptionId}): ${escapeMarkdown(assumption.content)}`; - // } - // return null; - // }).filter(al => !!al).join('
'); - // const mitigationsContent = mitigationLinks.map(ml => { - // const mitigation = data.mitigations?.find(m => m.id === ml.mitigationId); - // if (mitigation) { - // const mitigationId = `M-${standardizeNumericId(mitigation.numericId)}`; - // return `[**${mitigationId}**](#${mitigationId}): ${escapeMarkdown(mitigation.content)}`; - // } - // return null; - // }).filter(ml => !!ml).join('
'); - // const priority = x.metadata?.find(m => m.key === 'Priority')?.value || ''; - // const STRIDE = ((x.metadata?.find(m => m.key === 'STRIDE')?.value || []) as string[]).join(', '); - // const comments = await parseTableCellContent((x.metadata?.find(m => m.key === 'Comments')?.value as string) || ''); - // return `| ${threatId} | ${escapeMarkdown(x.statement || '')} | ${threatsOnly ? '' : `${mitigationsContent} | ${assumptionsContent} | `} ${priority} | ${STRIDE} | ${comments} |`; - // }); - - // rows.push(...(await Promise.all(promises))); - // } - - // rows.push('\n'); - - // return rows.join('\n'); }; export default getThreats; \ No newline at end of file