Skip to content

Commit

Permalink
chore(tsconfig): enable noUncheckedIndexedAccess (#336)
Browse files Browse the repository at this point in the history
  • Loading branch information
nbsp authored Nov 18, 2024
1 parent 2aa5d09 commit ab915ba
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 4 deletions.
5 changes: 5 additions & 0 deletions .changeset/flat-turtles-leave.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@livekit/rtc-node": patch
---

chore(tsconfig): enable `noUncheckedIndexedAccess`
4 changes: 2 additions & 2 deletions packages/livekit-rtc/src/audio_frame.ts
Original file line number Diff line number Diff line change
Expand Up @@ -72,8 +72,8 @@ export const combineAudioFrames = (buffer: AudioFrame | AudioFrame[]): AudioFram
throw new Error('buffer is empty');
}

const sampleRate = buffer[0].sampleRate;
const channels = buffer[0].channels;
const sampleRate = buffer[0]!.sampleRate;
const channels = buffer[0]!.channels;

let totalSamplesPerChannel = 0;
for (const frame of buffer) {
Expand Down
2 changes: 1 addition & 1 deletion packages/livekit-rtc/src/video_frame.ts
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ export class VideoFrame {
const planeInfos = getPlaneInfos(this.dataPtr, this.type, this.width, this.height);
if (planeNth >= planeInfos.length) return;

const planeInfo = planeInfos[planeNth];
const planeInfo = planeInfos[planeNth]!;
return FfiClient.instance.copyBuffer(planeInfo.dataPtr, planeInfo.size);
}

Expand Down
3 changes: 2 additions & 1 deletion packages/livekit-rtc/tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,8 @@
"moduleResolution": "node",
"sourceMap": true,
"outDir": "dist",
"strict": true
"strict": true,
"noUncheckedIndexedAccess": true
},
"include": ["src/**/*.ts"],
"exclude": ["src/**/*.test.ts", "vite.config.ts"]
Expand Down

0 comments on commit ab915ba

Please sign in to comment.