Adjust isUndefined check (#1546)
This commit is contained in:
@@ -1,5 +1,12 @@
|
||||
# CHANGELOG
|
||||
|
||||
## master
|
||||
|
||||
Changes:
|
||||
|
||||
- Adjust `isUndefined` check (local variable available)
|
||||
|
||||
|
||||
## 9.5.1 Jun 18, 2022
|
||||
|
||||
Contributed:
|
||||
|
||||
@@ -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);
|
||||
});
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user