From 1e11d63ba85e9ef76fe983f69b6a6c126ff75509 Mon Sep 17 00:00:00 2001 From: Jonathan Thomas Date: Wed, 5 Feb 2020 06:58:12 -0800 Subject: [PATCH] Fix Number cast in Network plugin Summary: Getting the error ``` $ /mnt/btrfs/trunk-hg-fb4a-fbsource-86184178-1580774714/xplat/sonar/node_modules/.bin/tsc --noemit src/plugins/network/index.tsx(180,59): error TS2349: This expression is not callable. Type 'Number' has no call signatures. error Command failed with exit code 1. ``` EDIT: This error was a red herring from another commit I was based on. Either way, `Number` is discouraged by the Typescript standard (https://www.typescriptlang.org/docs/handbook/declaration-files/do-s-and-don-ts.html), so let's move these to `number` instead. Reviewed By: mweststrate Differential Revision: D19712113 fbshipit-source-id: b754780063a1c429724abcd343da06514671bc83 --- src/plugins/network/index.tsx | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/plugins/network/index.tsx b/src/plugins/network/index.tsx index adc986959..f8e84349a 100644 --- a/src/plugins/network/index.tsx +++ b/src/plugins/network/index.tsx @@ -397,7 +397,8 @@ function calculateState( } rows.sort( - (a: TableBodyRow, b: TableBodyRow) => Number(a.sortKey) - Number(b.sortKey), + (a: TableBodyRow, b: TableBodyRow) => + (a.sortKey as number) - (b.sortKey as number), ); return {