From 6dcc1b7c9d0f81a2fcc43fa9388da5e6891d3d5a Mon Sep 17 00:00:00 2001 From: simon Date: Fri, 28 May 2021 12:43:20 +0200 Subject: [PATCH] chore: eslint and fix up old code --- src/app.ts | 2 +- src/radius/handler/eap/eapMethods/EAP-TTLS.ts | 6 ++---- 2 files changed, 3 insertions(+), 5 deletions(-) diff --git a/src/app.ts b/src/app.ts index 615ba5a..2ee2672 100644 --- a/src/app.ts +++ b/src/app.ts @@ -9,7 +9,7 @@ import { startTLSServer } from './tls/crypt'; /* test node version */ const testSocket = startTLSServer(); -if (typeof (testSocket.tls as any).exportKeyingMaterial !== 'function') { +if (typeof testSocket.tls.exportKeyingMaterial !== 'function') { console.error(`UNSUPPORTED NODE VERSION (${process.version}) FOUND!!`); console.log('min version supported is node js 14. run "sudo npx n 14"'); diff --git a/src/radius/handler/eap/eapMethods/EAP-TTLS.ts b/src/radius/handler/eap/eapMethods/EAP-TTLS.ts index 92430c5..31aed43 100644 --- a/src/radius/handler/eap/eapMethods/EAP-TTLS.ts +++ b/src/radius/handler/eap/eapMethods/EAP-TTLS.ts @@ -23,12 +23,10 @@ import { secret } from '../../../../../config'; const log = debug('radius:eap:ttls'); -function tlsHasExportKeyingMaterial( - tlsSocket -): tlsSocket is { +function tlsHasExportKeyingMaterial(tlsSocket): tlsSocket is { exportKeyingMaterial: (length: number, label: string, context?: Buffer) => Buffer; } { - return typeof (tlsSocket as any).exportKeyingMaterial === 'function'; + return typeof tlsSocket.exportKeyingMaterial === 'function'; } interface IAVPEntry {