Skip to content

Commit c331d11

Browse files
davidaurelioFacebook Github Bot 5
authored andcommitted
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
1 parent e7499e3 commit c331d11

File tree

5 files changed

+38
-3
lines changed

5 files changed

+38
-3
lines changed

Libraries/CustomComponents/ListView/ListView.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ var ScrollResponder = require('ScrollResponder');
3434
var StaticRenderer = require('StaticRenderer');
3535
var TimerMixin = require('react-timer-mixin');
3636

37-
var isEmpty = require('fbjs/lib/isEmpty');
37+
var isEmpty = require('isEmpty');
3838
var merge = require('merge');
3939

4040
var PropTypes = React.PropTypes;

Libraries/CustomComponents/ListView/ListViewDataSource.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@
2929
'use strict';
3030

3131
var invariant = require('fbjs/lib/invariant');
32-
var isEmpty = require('fbjs/lib/isEmpty');
32+
var isEmpty = require('isEmpty');
3333
var warning = require('fbjs/lib/warning');
3434

3535
function defaultGetRowData(

Libraries/CustomComponents/NavigationExperimental/NavigationCardStack.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ const React = require('React');
3636
const ReactComponentWithPureRenderMixin = require('ReactComponentWithPureRenderMixin');
3737
const StyleSheet = require('StyleSheet');
3838

39-
const emptyFunction = require('emptyFunction');
39+
const emptyFunction = require('fbjs/lib/emptyFunction');
4040

4141
const {PropTypes} = React;
4242
const {Directions} = NavigationLinearPanResponder;

Libraries/vendor/core/isEmpty.js

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
/**
2+
* @generated SignedSource<<97ffcebc9ae390e734026a4f3964bff6>>
3+
*
4+
* !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
5+
* !! This file is a check-in of a static_upstream project! !!
6+
* !! !!
7+
* !! You should not modify this file directly. Instead: !!
8+
* !! 1) Use `fjs use-upstream` to temporarily replace this with !!
9+
* !! the latest version from upstream. !!
10+
* !! 2) Make your changes, test them, etc. !!
11+
* !! 3) Use `fjs push-upstream` to copy your changes back to !!
12+
* !! static_upstream. !!
13+
* !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
14+
*
15+
* @providesModule isEmpty
16+
*/
17+
18+
/**
19+
* Mimics empty from PHP.
20+
*/
21+
function isEmpty(obj) {
22+
if (Array.isArray(obj)) {
23+
return obj.length === 0;
24+
} else if (typeof obj === 'object') {
25+
for (var i in obj) {
26+
return false;
27+
}
28+
return true;
29+
} else {
30+
return !obj;
31+
}
32+
}
33+
34+
module.exports = isEmpty;

packager/blacklist.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@ var sharedBlacklist = [
1919

2020
// fbjs forks:
2121
'node_modules/fbjs/lib/Map.js',
22+
'node_modules/fbjs/lib/isEmpty.js',
2223

2324
/website\/node_modules\/.*/,
2425

0 commit comments

Comments
 (0)