Export typeUtils from flipper-common

Reviewed By: passy

Differential Revision: D36098166

fbshipit-source-id: 0f3da1d17da8ff6d08bc05abe73f9657df3bc3b8
This commit is contained in:
Andrey Goncharov
2022-05-10 05:13:24 -07:00
committed by Facebook GitHub Bot
parent 2854e75e9c
commit 5a5c0ce426
2 changed files with 15 additions and 0 deletions

View File

@@ -49,6 +49,7 @@ export {
deserializeRemoteError,
} from './utils/errors';
export {createControlledPromise} from './utils/controlledPromise';
export * from './utils/typeUtils';
export * from './GK';
export * from './clientUtils';
export * from './settings';

View 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;
}