From 51e5da2d935976b9be1f6103c3ea08753b17e751 Mon Sep 17 00:00:00 2001 From: shinyoshiaki Date: Sun, 22 Dec 2024 16:22:52 +0900 Subject: [PATCH] refactor --- packages/dtls/src/flight/server/flight2.ts | 8 +++++--- packages/dtls/src/index.ts | 2 +- packages/dtls/src/record/receive.ts | 2 +- packages/sctp/src/index.ts | 2 +- packages/webrtc/src/const.ts | 4 ++-- 5 files changed, 10 insertions(+), 8 deletions(-) diff --git a/packages/dtls/src/flight/server/flight2.ts b/packages/dtls/src/flight/server/flight2.ts index 31b9c45e..ad7dc9c2 100644 --- a/packages/dtls/src/flight/server/flight2.ts +++ b/packages/dtls/src/flight/server/flight2.ts @@ -104,9 +104,11 @@ export const flight2 = dtls.remoteExtendedMasterSecret = true; } break; - case RenegotiationIndication.type: { - log(dtls.sessionId, "RenegotiationIndication", extension.data); - } + case RenegotiationIndication.type: + { + log(dtls.sessionId, "RenegotiationIndication", extension.data); + } + break; case 43: { // todo dtls1.3 diff --git a/packages/dtls/src/index.ts b/packages/dtls/src/index.ts index d9fc29b5..41c89999 100644 --- a/packages/dtls/src/index.ts +++ b/packages/dtls/src/index.ts @@ -1,7 +1,7 @@ export { DtlsClient } from "./client"; export { DtlsServer } from "./server"; export { DtlsSocket } from "./socket"; -export { createUdpTransport, Transport, UdpTransport } from "./transport"; +export { createUdpTransport, type Transport, UdpTransport } from "./transport"; /* Client Server ------ ------ diff --git a/packages/dtls/src/record/receive.ts b/packages/dtls/src/record/receive.ts index 683348d6..73b1a3ba 100644 --- a/packages/dtls/src/record/receive.ts +++ b/packages/dtls/src/record/receive.ts @@ -85,8 +85,8 @@ export const parsePlainText = if (alert.level > 1) { throw new Error("alert fatal error"); } + return { type: ContentType.alert, data: undefined }; } - // eslint-disable-next-line no-fallthrough default: { return { type: ContentType.alert, data: undefined }; } diff --git a/packages/sctp/src/index.ts b/packages/sctp/src/index.ts index 86a9f3e5..a3c065cf 100644 --- a/packages/sctp/src/index.ts +++ b/packages/sctp/src/index.ts @@ -1,3 +1,3 @@ export { SCTP_STATE, WEBRTC_PPID } from "./const"; export { SCTP } from "./sctp"; -export { Transport } from "./transport"; +export type { Transport } from "./transport"; diff --git a/packages/webrtc/src/const.ts b/packages/webrtc/src/const.ts index fb6bf85f..a1546670 100644 --- a/packages/webrtc/src/const.ts +++ b/packages/webrtc/src/const.ts @@ -1,5 +1,5 @@ import { - HashAlgorithms, + type HashAlgorithms, SignatureAlgorithm, } from "../../dtls/src/cipher/const"; import { @@ -63,4 +63,4 @@ export const SRTP_PROFILE = { export const SenderDirections = ["sendonly", "sendrecv"]; export const ReceiverDirection = ["sendrecv", "recvonly"]; -export { HashAlgorithms, SignatureAlgorithm }; +export { type HashAlgorithms, SignatureAlgorithm };