Adjust isUndefined check (#1546)

This commit is contained in:
Jaco
2022-06-18 21:33:19 +03:00
committed by GitHub
parent 50b494ee2e
commit 4a6e620acc
3 changed files with 11 additions and 1 deletions
+7
View File
@@ -1,5 +1,12 @@
# CHANGELOG
## master
Changes:
- Adjust `isUndefined` check (local variable available)
## 9.5.1 Jun 18, 2022
Contributed:
+3
View File
@@ -1,6 +1,7 @@
// Copyright 2017-2022 @polkadot/util authors & contributors
// SPDX-License-Identifier: Apache-2.0
import { performance } from '../test/performance';
import { isUndefined } from '.';
describe('isUndefined', (): void => {
@@ -15,4 +16,6 @@ describe('isUndefined', (): void => {
isUndefined(null)
).toEqual(false);
});
performance('isUndefined', 10_000_000, [[null]], isUndefined);
});
+1 -1
View File
@@ -17,5 +17,5 @@
*/
// eslint-disable-next-line @typescript-eslint/no-explicit-any
export function isUndefined (value?: unknown): value is undefined {
return typeof value === 'undefined';
return value === undefined;
}