Free, Open Source, Self-Hosted WhatsApp API Gateway
TypeScript apibotgatewayself-hostedwhatsappwhatsapp-apiwhatsapp-automationwhatsapp-botwhatsapp-gatewaywhatsapp-gateway-apiwhatsapp-webwhatsapp-web-api
fix(audit): correct type-narrowing in the emit-coverage spec (#705)
Yudhi Armyndharis4f34977b3446
diff --git a/src/modules/audit/audit-coverage.spec.ts b/src/modules/audit/audit-coverage.spec.tsindex dc85ea1ba..c6cf9001e 100644--- a/src/modules/audit/audit-coverage.spec.ts+++ b/src/modules/audit/audit-coverage.spec.ts@@ -38,8 +38,8 @@ const sourceBodies = listTsFiles(SRC_DIR)const memberKeys = Object.keys(AuditAction) as (keyof typeof AuditAction)[];-const isEmitted = (key: keyof typeof AuditAction): boolean =>- sourceBodies.some(body => body.includes(`AuditAction.${key}`));+const isEmitted = (key: keyof typeof AuditAction | undefined): boolean =>+ key !== undefined && sourceBodies.some(body => body.includes(`AuditAction.${key}`));const memberKeyForValue = (value: string): keyof typeof AuditAction | undefined =>memberKeys.find(k => AuditAction[k] === (value as AuditAction));