Flowify Process Color

Reviewed By: achen1

Differential Revision: D4924691

fbshipit-source-id: 11ff623be63062f01cb71c7d77e1438d3e495035
This commit is contained in:
Eli White 2017-04-26 11:30:55 -07:00 committed by Facebook Github Bot
parent ec7a817f09
commit c7e0f56d75
2 changed files with 10 additions and 7 deletions

View File

@ -12,12 +12,14 @@
'use strict';
const Platform = require('Platform');
const invariant = require('fbjs/lib/invariant');
const processColor = require('processColor');
const {
ActionSheetManager,
ShareModule
} = require('NativeModules');
const invariant = require('fbjs/lib/invariant');
const processColor = require('processColor');
type Content = { title?: string, message: string } | { title?: string, url: string };
type Options = { dialogTitle?: string, excludeActivityTypes?: Array<string>, tintColor?: string };

View File

@ -7,21 +7,22 @@
* of patent rights can be found in the PATENTS file in the same directory.
*
* @providesModule processColor
* @flow
*/
'use strict';
var Platform = require('Platform');
const Platform = require('Platform');
var normalizeColor = require('normalizeColor');
const normalizeColor = require('normalizeColor');
/* eslint no-bitwise: 0 */
function processColor(color) {
function processColor(color?: string | number): ?number {
if (color === undefined || color === null) {
return color;
}
var int32Color = normalizeColor(color);
if (int32Color === null) {
let int32Color = normalizeColor(color);
if (int32Color === null || int32Color === undefined) {
return undefined;
}