Free, Open Source, Self-Hosted WhatsApp API Gateway
TypeScript apibotgatewayself-hostedwhatsappwhatsapp-apiwhatsapp-automationwhatsapp-botwhatsapp-gatewaywhatsapp-gateway-apiwhatsapp-webwhatsapp-web-api
perf(logger): skip the form lookup for a plain object
Yudhi Armyndharis6b24cf54e46f
diff --git a/src/common/services/logger.service.ts b/src/common/services/logger.service.tsindex 6baf4f094..c326fba6b 100644--- a/src/common/services/logger.service.ts+++ b/src/common/services/logger.service.ts@@ -197,7 +197,10 @@ export function redactSecrets(value: unknown, options: RedactOptions = {}): unknfor (let index = 0; index < length; index++) if (index in list) plain[index] = copy(list[index]);return plain;}- const source = writtenForm(node, form, isSecretKey, marker) as Record<string, unknown>;+ // A plain object, by far the most common, is its own form: the call is left out, as it costs an ordinary line.+ const source = (+ form === undefined && !ArrayBuffer.isView(node) ? node : writtenForm(node, form, isSecretKey, marker)+ ) as Record<string, unknown>;const keys = Object.keys(source);if (keys.length > left) {// Listed once, then charged: another reference to this object, or any other node, is refused without listing.