chore(deps): bump typescript to 4.8.4 (#24272)

Co-authored-by: Ville Brofeldt <33317356+villebro@users.noreply.github.com>
This commit is contained in:
Jan Suleiman
2024-01-29 17:14:24 +01:00
committed by GitHub
parent f73760a5d1
commit 29582e8d86
10 changed files with 31 additions and 20 deletions

View File

@@ -16,6 +16,9 @@
* specific language governing permissions and limitations
* under the License.
*/
import { isNil } from 'lodash';
export default function extent<T = number | string | Date | undefined | null>(
values: T[],
) {
@@ -24,16 +27,16 @@ export default function extent<T = number | string | Date | undefined | null>(
// eslint-disable-next-line no-restricted-syntax
for (const value of values) {
if (value !== null) {
if (min === undefined) {
if (isNil(min)) {
if (value !== undefined) {
min = value;
max = value;
}
} else {
} else if (value !== undefined) {
if (min > value) {
min = value;
}
if (max !== undefined) {
if (!isNil(max)) {
if (max < value) {
max = value;
}