mirror of
https://github.com/zhigang1992/react-native.git
synced 2026-04-26 23:05:00 +08:00
Fix breakages caused by switch to fbjs
Summary: This fixes a couple of breakages introduced by the switch to fbjs Reviewed By: bestander Differential Revision: D3000078 fb-gh-sync-id: 2971d049030f754d5001f6729716373a64078ddf shipit-source-id: 2971d049030f754d5001f6729716373a64078ddf
This commit is contained in:
committed by
Facebook Github Bot 5
parent
e7499e39a4
commit
c331d113dc
34
Libraries/vendor/core/isEmpty.js
vendored
Normal file
34
Libraries/vendor/core/isEmpty.js
vendored
Normal file
@@ -0,0 +1,34 @@
|
||||
/**
|
||||
* @generated SignedSource<<97ffcebc9ae390e734026a4f3964bff6>>
|
||||
*
|
||||
* !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
|
||||
* !! This file is a check-in of a static_upstream project! !!
|
||||
* !! !!
|
||||
* !! You should not modify this file directly. Instead: !!
|
||||
* !! 1) Use `fjs use-upstream` to temporarily replace this with !!
|
||||
* !! the latest version from upstream. !!
|
||||
* !! 2) Make your changes, test them, etc. !!
|
||||
* !! 3) Use `fjs push-upstream` to copy your changes back to !!
|
||||
* !! static_upstream. !!
|
||||
* !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
|
||||
*
|
||||
* @providesModule isEmpty
|
||||
*/
|
||||
|
||||
/**
|
||||
* Mimics empty from PHP.
|
||||
*/
|
||||
function isEmpty(obj) {
|
||||
if (Array.isArray(obj)) {
|
||||
return obj.length === 0;
|
||||
} else if (typeof obj === 'object') {
|
||||
for (var i in obj) {
|
||||
return false;
|
||||
}
|
||||
return true;
|
||||
} else {
|
||||
return !obj;
|
||||
}
|
||||
}
|
||||
|
||||
module.exports = isEmpty;
|
||||
Reference in New Issue
Block a user