From 7e9fd6b0716bc5f0f734b737e2e1feb59d9bc019 Mon Sep 17 00:00:00 2001 From: Sebastian Malton Date: Mon, 19 Apr 2021 11:38:57 -0400 Subject: [PATCH] fix comments Signed-off-by: Sebastian Malton --- src/common/utils/type-narrowing.ts | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/common/utils/type-narrowing.ts b/src/common/utils/type-narrowing.ts index 86d273cefd..9cfe6934c5 100644 --- a/src/common/utils/type-narrowing.ts +++ b/src/common/utils/type-narrowing.ts @@ -1,7 +1,7 @@ /** * Narrows `val` to include the property `key` (if true is returned) * @param val The object to be tested - * @param key The key to test if it is present on the object (must be a literal for tsc to do any type meaningful) + * @param key The key to test if it is present on the object (must be a literal for tsc to do any meaningful typing) */ export function hasOwnProperty(val: S, key: K): val is (S & { [key in K]: unknown }) { // this call syntax is for when `val` was created by `Object.create(null)` @@ -11,7 +11,7 @@ export function hasOwnProperty(val: S, /** * Narrows `val` to a static type that includes fields of names in `keys` * @param val the value that we are trying to type narrow - * @param keys the key names (must be literals for tsc to do any type meaningful) + * @param keys the key names (must be literals for tsc to do any meaningful typing) */ export function hasOwnProperties(val: S, ...keys: K[]): val is (S & { [key in K]: unknown }) { return keys.every(key => hasOwnProperty(val, key)); @@ -20,7 +20,7 @@ export function hasOwnProperties(val: S /** * Narrows `val` to include the property `key` with type `V` * @param val the value that we are trying to type narrow - * @param key The key to test if it is present on the object (must be a literal for tsc to do any type meaningful) + * @param key The key to test if it is present on the object (must be a literal for tsc to do any meaningful typing) * @param isValid a function to check if the field is valid */ export function hasTypedProperty(val: S, key: K, isValid: (value: unknown) => value is V): val is (S & { [key in K]: V }) { @@ -30,7 +30,7 @@ export function hasTypedProperty(val /** * Narrows `val` to include the property `key` with type `V | undefined` or doesn't contain it * @param val the value that we are trying to type narrow - * @param key The key to test if it is present on the object (must be a literal for tsc to do any type meaningful) + * @param key The key to test if it is present on the object (must be a literal for tsc to do any meaningful typing) * @param isValid a function to check if the field (when present) is valid */ export function hasOptionalProperty(val: S, key: K, isValid: (value: unknown) => value is V): val is (S & { [key in K]?: V }) {