mirror of
https://github.com/facebook/react-native.git
synced 2025-11-01 09:14:26 +00:00
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
This commit is contained in:
committed by
Facebook Github Bot
parent
da3e23fa70
commit
2d99b3bab3
Vendored
-29
@@ -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;
|
||||
Reference in New Issue
Block a user