From b55a1cc1b3c43cc05eea89e319194bd213ea5dc1 Mon Sep 17 00:00:00 2001 From: Denis Simonov Date: Tue, 28 May 2024 02:59:30 +0300 Subject: [PATCH] Sort openPorts and failedPorts before returning --- api/ports.js | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/api/ports.js b/api/ports.js index 63e2c25d..ea188bd0 100644 --- a/api/ports.js +++ b/api/ports.js @@ -72,7 +72,11 @@ const handler = async (url, event, context) => { if(timeoutReached){ return errorResponse('The function timed out before completing.'); } - + + // Sort openPorts and failedPorts before returning + openPorts.sort((a, b) => a - b); + failedPorts.sort((a, b) => a - b); + return { openPorts, failedPorts }; };