diff --git a/packages/drivers/odsp-driver/src/WriteBufferUtils.ts b/packages/drivers/odsp-driver/src/WriteBufferUtils.ts index 09fcbf0f3fb0..fee46a4e001c 100644 --- a/packages/drivers/odsp-driver/src/WriteBufferUtils.ts +++ b/packages/drivers/odsp-driver/src/WriteBufferUtils.ts @@ -233,8 +233,8 @@ function serializeNodeCore( for (const child of nodeCore.nodes) { if (child instanceof NodeCore) { // For a tree node start and end with set/list start and end marker codes. - const startCode: MarkerCodesStart | undefined = MarkerCodesStart[child.type]; - const endCode: MarkerCodesEnd | undefined = MarkerCodesEnd[child.type]; + const startCode = MarkerCodesStart[child.type]; + const endCode = MarkerCodesEnd[child.type]; assert(startCode !== undefined, 0x285 /* "Start code should not undefined" */); assert(endCode !== undefined, 0x286 /* "End code should not undefined" */); buffer.write(startCode); diff --git a/packages/drivers/odsp-driver/src/odspDocumentStorageServiceBase.ts b/packages/drivers/odsp-driver/src/odspDocumentStorageServiceBase.ts index 738a49092d99..39fdb72e3645 100644 --- a/packages/drivers/odsp-driver/src/odspDocumentStorageServiceBase.ts +++ b/packages/drivers/odsp-driver/src/odspDocumentStorageServiceBase.ts @@ -257,9 +257,8 @@ export abstract class OdspDocumentStorageServiceBase implements IDocumentStorage protected combineProtocolAndAppSnapshotTree(snapshotTree: ISnapshotTree): ISnapshotTree { // When we upload the container snapshot, we upload appTree in ".app" and protocol tree in ".protocol" // So when we request the snapshot we get ".app" as tree and not as commit node as in the case just above. - const hierarchicalAppTree: ISnapshotTree | undefined = snapshotTree.trees[".app"]; - const hierarchicalProtocolTree: ISnapshotTree | undefined = - snapshotTree.trees[".protocol"]; + const hierarchicalAppTree = snapshotTree.trees[".app"]; + const hierarchicalProtocolTree = snapshotTree.trees[".protocol"]; const summarySnapshotTree: ISnapshotTree = { blobs: { ...hierarchicalAppTree.blobs, diff --git a/packages/drivers/odsp-driver/src/test/createNewUtilsTests.spec.ts b/packages/drivers/odsp-driver/src/test/createNewUtilsTests.spec.ts index 335db33bf581..2dfed6c5e796 100644 --- a/packages/drivers/odsp-driver/src/test/createNewUtilsTests.spec.ts +++ b/packages/drivers/odsp-driver/src/test/createNewUtilsTests.spec.ts @@ -7,11 +7,7 @@ import { strict as assert } from "node:assert"; import { bufferToString, fromBase64ToUtf8 } from "@fluid-internal/client-utils"; import { ISummaryTree, SummaryType } from "@fluidframework/driver-definitions"; -import { - ISnapshot, - IDocumentAttributes, - type ISnapshotTree, -} from "@fluidframework/driver-definitions/internal"; +import { ISnapshot, IDocumentAttributes } from "@fluidframework/driver-definitions/internal"; import { IFileEntry, IOdspResolvedUrl, @@ -143,18 +139,18 @@ describe("Create New Utils Tests", () => { ); assert.strictEqual(snapshot.blobContents.size, 2, "2 blobs should be there"); - const appTree: ISnapshotTree | undefined = snapshotTree.trees[".app"]; - const protocolTree: ISnapshotTree | undefined = snapshotTree.trees[".protocol"]; + const appTree = snapshotTree.trees[".app"]; + const protocolTree = snapshotTree.trees[".protocol"]; assert(appTree !== undefined, "App tree should be there"); assert(protocolTree !== undefined, "Protocol tree should be there"); - const appTreeBlobId: string | undefined = appTree.blobs.attributes; + const appTreeBlobId = appTree.blobs.attributes; const appTreeBlobValBuffer = snapshot.blobContents.get(appTreeBlobId); assert(appTreeBlobValBuffer !== undefined, "app blob value should exist"); const appTreeBlobVal = bufferToString(appTreeBlobValBuffer, "utf8"); assert(appTreeBlobVal === blobContent, "Blob content should match"); - const docAttributesBlobId: string | undefined = protocolTree.blobs.attributes; + const docAttributesBlobId = protocolTree.blobs.attributes; const docAttributesBuffer = snapshot.blobContents.get(docAttributesBlobId); assert(docAttributesBuffer !== undefined, "protocol attributes blob value should exist"); const docAttributesBlobValue = bufferToString(docAttributesBuffer, "utf8"); diff --git a/packages/drivers/replay-driver/src/storageImplementations.ts b/packages/drivers/replay-driver/src/storageImplementations.ts index 9ba488ee2b0a..63c8c02d4102 100644 --- a/packages/drivers/replay-driver/src/storageImplementations.ts +++ b/packages/drivers/replay-driver/src/storageImplementations.ts @@ -80,9 +80,9 @@ export class FileSnapshotReader throw new Error(`Unknown version id: ${versionRequested}`); } - let snapshotTree: ISnapshotTree | undefined = this.trees[versionRequested.id]; + let snapshotTree = this.trees[versionRequested.id]; if (snapshotTree === undefined) { - const tree: ITree | undefined = this.commits[versionRequested.id]; + const tree = this.commits[versionRequested.id]; if (tree === undefined) { throw new Error(`Can't find version ${versionRequested.id}`); } diff --git a/packages/runtime/container-runtime/src/test/containerRuntime.spec.ts b/packages/runtime/container-runtime/src/test/containerRuntime.spec.ts index 1076182e120f..f195841000d6 100644 --- a/packages/runtime/container-runtime/src/test/containerRuntime.spec.ts +++ b/packages/runtime/container-runtime/src/test/containerRuntime.spec.ts @@ -31,7 +31,6 @@ import { type FetchSource, type IDocumentAttributes, SummaryType, - type SummaryObject, } from "@fluidframework/driver-definitions/internal"; import { ISummaryTreeWithStats, @@ -2094,7 +2093,7 @@ describe("Runtime", () => { false, ); const { summary } = await containerRuntime.summarize({ fullTree: true }); - const blob: SummaryObject | undefined = summary.tree[recentBatchInfoBlobName]; + const blob = summary.tree[recentBatchInfoBlobName]; assert(blob.type === SummaryType.Blob, "Expected blob"); assert.equal(blob.content, '[[123,"batchId1"]]', "Expected single batchId mapping"); diff --git a/packages/runtime/runtime-utils/src/test/summaryUtils.spec.ts b/packages/runtime/runtime-utils/src/test/summaryUtils.spec.ts index 927b31cde6f8..17527dcdbd03 100644 --- a/packages/runtime/runtime-utils/src/test/summaryUtils.spec.ts +++ b/packages/runtime/runtime-utils/src/test/summaryUtils.spec.ts @@ -411,7 +411,7 @@ describe("Summary Utils", () => { const blobContent = "testBlobContent"; summaryTreeBuilder.addBlob("testBlob", blobContent); const summaryTree = summaryTreeBuilder.summary; - const blob: SummaryObject | undefined = summaryTree.tree.testBlob; + const blob = summaryTree.tree.testBlob; assert.strictEqual(blob.type, SummaryType.Blob); assert.strictEqual(blob.content, blobContent); }); @@ -432,7 +432,7 @@ describe("Summary Utils", () => { const handle = "testHandle"; summaryTreeBuilder.addHandle("testHandleKey", SummaryType.Tree, handle); const summaryTree = summaryTreeBuilder.summary; - const handleObject: SummaryObject | undefined = summaryTree.tree.testHandleKey; + const handleObject = summaryTree.tree.testHandleKey; assert.strictEqual(handleObject.type, SummaryType.Handle); assert.strictEqual(handleObject.handleType, SummaryType.Tree); assert.strictEqual(handleObject.handle, handle); @@ -453,7 +453,7 @@ describe("Summary Utils", () => { const attachmentId = "testAttachmentId"; summaryTreeBuilder.addAttachment(attachmentId); const summaryTree = summaryTreeBuilder.summary; - const attachment: SummaryObject | undefined = summaryTree.tree["0"]; + const attachment = summaryTree.tree["0"]; assert.strictEqual(attachment.type, SummaryType.Attachment); assert.strictEqual(attachment.id, attachmentId); }); @@ -473,7 +473,7 @@ describe("Summary Utils", () => { }; summaryTreeBuilder.addWithStats("testKey", summarizeResult); const summaryTree = summaryTreeBuilder.summary; - const subTree: SummaryObject | undefined = summaryTree.tree.testKey; + const subTree = summaryTree.tree.testKey; assert.strictEqual(subTree.type, SummaryType.Tree); const stats = summaryTreeBuilder.stats; assert.strictEqual(stats.blobNodeCount, 1); diff --git a/packages/test/test-drivers/src/routerliciousTestDriver.ts b/packages/test/test-drivers/src/routerliciousTestDriver.ts index 9aab0f4916af..5136522289de 100644 --- a/packages/test/test-drivers/src/routerliciousTestDriver.ts +++ b/packages/test/test-drivers/src/routerliciousTestDriver.ts @@ -87,8 +87,7 @@ function getLegacyConfigFromEnv() { } function getEndpointConfigFromEnv(r11sEndpointName: RouterliciousEndpoint) { - const configStr: string | undefined = - process.env[`fluid__test__driver__${r11sEndpointName}`]; + const configStr = process.env[`fluid__test__driver__${r11sEndpointName}`]; if (r11sEndpointName === "docker") { const dockerDriverPolicies = configStr === undefined ? configStr : JSON.parse(configStr).driverPolicies; diff --git a/packages/tools/devtools/devtools-core/src/data-visualization/DataVisualization.ts b/packages/tools/devtools/devtools-core/src/data-visualization/DataVisualization.ts index 01670ad64af9..9d425a008a3c 100644 --- a/packages/tools/devtools/devtools-core/src/data-visualization/DataVisualization.ts +++ b/packages/tools/devtools/devtools-core/src/data-visualization/DataVisualization.ts @@ -263,8 +263,7 @@ export class DataVisualizerGraph this.visualizers[sharedObject.attributes.type] ?? visualizeUnknownSharedObject; // Create visualizer node for the shared object - const editorFunction: EditSharedObject | undefined = - this.editors[sharedObject.attributes.type]; + const editorFunction = this.editors[sharedObject.attributes.type]; const visualizerNode = new VisualizerNode( sharedObject, diff --git a/packages/tools/devtools/devtools-view/src/components/graphs/DynamicComposedChart.tsx b/packages/tools/devtools/devtools-view/src/components/graphs/DynamicComposedChart.tsx index 9b00b58cc79b..10adcfa87645 100644 --- a/packages/tools/devtools/devtools-view/src/components/graphs/DynamicComposedChart.tsx +++ b/packages/tools/devtools/devtools-view/src/components/graphs/DynamicComposedChart.tsx @@ -62,7 +62,7 @@ const mergeDataSets = (dataSets: GraphDataSet[]): DataPoint[] => { for (const dataSet of dataSets) { const { yAxisDataKey, xAxisDataKey, uuid } = dataSet.schema; for (const dataPoint of dataSet.data) { - const xAxisDataPoint: string | number | undefined = dataPoint[xAxisDataKey]; + const xAxisDataPoint = dataPoint[xAxisDataKey]; xAxisDataPointToYAxisDataPointMap[xAxisDataPoint] = { ...xAxisDataPointToYAxisDataPointMap[xAxisDataPoint], [uuid]: dataPoint[yAxisDataKey],