Export typeUtils from flipper-common
Reviewed By: passy Differential Revision: D36098166 fbshipit-source-id: 0f3da1d17da8ff6d08bc05abe73f9657df3bc3b8
This commit is contained in:
committed by
Facebook GitHub Bot
parent
2854e75e9c
commit
5a5c0ce426
@@ -49,6 +49,7 @@ export {
|
|||||||
deserializeRemoteError,
|
deserializeRemoteError,
|
||||||
} from './utils/errors';
|
} from './utils/errors';
|
||||||
export {createControlledPromise} from './utils/controlledPromise';
|
export {createControlledPromise} from './utils/controlledPromise';
|
||||||
|
export * from './utils/typeUtils';
|
||||||
export * from './GK';
|
export * from './GK';
|
||||||
export * from './clientUtils';
|
export * from './clientUtils';
|
||||||
export * from './settings';
|
export * from './settings';
|
||||||
|
|||||||
14
desktop/flipper-common/src/utils/typeUtils.tsx
Normal file
14
desktop/flipper-common/src/utils/typeUtils.tsx
Normal file
@@ -0,0 +1,14 @@
|
|||||||
|
/**
|
||||||
|
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
||||||
|
*
|
||||||
|
* This source code is licensed under the MIT license found in the
|
||||||
|
* LICENSE file in the root directory of this source tree.
|
||||||
|
*
|
||||||
|
* @format
|
||||||
|
*/
|
||||||
|
|
||||||
|
// Typescript doesn't know Array.filter(Boolean) won't contain nulls.
|
||||||
|
// So use Array.filter(notNull) instead.
|
||||||
|
export function notNull<T>(x: T | null | undefined): x is T {
|
||||||
|
return x !== null && x !== undefined;
|
||||||
|
}
|
||||||
Reference in New Issue
Block a user