From 2d99b3bab3803906c4c590cc0bc618708a2da57b Mon Sep 17 00:00:00 2001 From: Tim Yung Date: Sat, 12 Oct 2019 15:47:17 -0700 Subject: [PATCH] RN: Delete `isEmpty` Summary: Deletes `isEmpty` because there are no more references to it in `react-native`. Changelog: [Internal] Reviewed By: zackargyle, fred2028 Differential Revision: D17884310 fbshipit-source-id: 0554aee4044452b6c04f638f1ad762025eecd929 --- Libraries/vendor/core/isEmpty.js | 29 ----------------------------- 1 file changed, 29 deletions(-) delete mode 100644 Libraries/vendor/core/isEmpty.js diff --git a/Libraries/vendor/core/isEmpty.js b/Libraries/vendor/core/isEmpty.js deleted file mode 100644 index 78f8841d000..00000000000 --- a/Libraries/vendor/core/isEmpty.js +++ /dev/null @@ -1,29 +0,0 @@ -/** - * Copyright (c) Facebook, Inc. and its affiliates. - * - * This source code is licensed under the MIT license found in the - * LICENSE file in the root directory of this source tree. - * - * @flow strict - * @format - */ - -'use strict'; - -/** - * Mimics empty from PHP. - */ -function isEmpty(obj: mixed): boolean { - if (Array.isArray(obj)) { - return obj.length === 0; - } else if (typeof obj === 'object') { - for (const i in obj) { - return false; - } - return true; - } else { - return !obj; - } -} - -module.exports = isEmpty;