From 0ed31d1abf7afa74bb85860f2ab892fa99574d03 Mon Sep 17 00:00:00 2001 From: Laila Los <44241786+ElectronicBlueberry@users.noreply.github.com> Date: Wed, 1 Feb 2023 12:46:12 +0100 Subject: [PATCH] run prettier on docs --- client/docs/typescript-handling-undefined-values.md | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/client/docs/typescript-handling-undefined-values.md b/client/docs/typescript-handling-undefined-values.md index 16a64497ad9..b300d871ec8 100644 --- a/client/docs/typescript-handling-undefined-values.md +++ b/client/docs/typescript-handling-undefined-values.md @@ -10,10 +10,10 @@ Here's an example of what this rule enforces: ```ts type NumberDictionary = { [key: string]: number; -} +}; const object: NumberDictionary = { - keyA: 1 + keyA: 1, }; // type of a is number, but it is clearly undefined here @@ -25,10 +25,10 @@ const a = object.keyB; ```ts type NumberDictionary = { [key: string]: number; -} +}; const object: NumberDictionary = { - keyA: 1 + keyA: 1, }; // type of a is number | undefined, improving type safety @@ -142,7 +142,6 @@ let terminalSource = outputStep.outputs.find((output) => output.name === connect This code will compile with errors, because `outputStep` is potentially undefined. While we may know that this state is not possible, a future error or mistake may still make it possible and properly asserting can be helpful. Here I'm using the new `assertDefined` utility. - ```ts const outputStep = this.stepStore.getStep(connection.output.stepId); assertDefined(outputStep, `No such step with id ${connection.output.stepId}`);