You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+8-5Lines changed: 8 additions & 5 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1846,20 +1846,23 @@ The **return value** is a `boolean` indicating whether or not the `value` is an
1846
1846
1847
1847
`4.0.0`: The function uses [`isObjectKey`](#isobjectkey) function to check the `value` and has [`callback`](#resultcallback) as optional instead of the [`guardObject`](#guardobject).
1848
1848
1849
-
Use `guardObjectKey()` or `guard.is.objectKey()` to guard the `value` to be an `object` of a generic `Obj` type that contains the `key` property of the [`Key`][key] type.
1849
+
`4.0.1`: Fix guards the `key` by changing its type to `keyof Obj` instead of just a [`Key`][key].
1850
+
1851
+
Use `guardObjectKey()` or `guard.is.objectKey()` to guard the `value` to be an `object` of a generic `Obj` type that contains the `key`.
| value |`Obj`| A generic `Obj` type `value` that contains the `key` to guard |
1859
-
| key |[`Key`][key]\|[`Key[]`][key]| A [`Key`][key] type or an array of [`Key`][key] type name of the property that the `value` contains |
1862
+
| key |`keyof Obj`\|`(keyof Obj)[]`| A key of `Obj`or an array key of `Obj` type as the name of the property that the `value` contains |
1860
1863
| callback? |[`ResultCallback`][resultcallback]| An Optional [`ResultCallback`][resultcallback] function to handle result before returns eg. to throw an `Error`|
1861
1864
1862
-
The **return value** is a `boolean` indicating whether or not the `value` is an `object` of a generic `Obj` containing the [`Key`][key].
1865
+
The **return value** is a `boolean` indicating whether or not the `value` is an `object` of a generic `Obj` containing the `key`.
0 commit comments