Prettier React Native Libraries

Reviewed By: sahrens

Differential Revision: D7961488

fbshipit-source-id: 05f9b8b0b91ae77f9040a5321ccc18f7c3c1ce9a
This commit is contained in:
Eli White
2018-05-10 19:06:46 -07:00
committed by Facebook Github Bot
parent 1e2de71290
commit d01ab66b47
301 changed files with 6259 additions and 3781 deletions

View File

@@ -4,8 +4,10 @@
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*
* @format
* @flow
*/
'use strict';
const NativeEventEmitter = require('NativeEventEmitter');
@@ -14,8 +16,10 @@ const Platform = require('Platform');
const invariant = require('fbjs/lib/invariant');
const LinkingManager = Platform.OS === 'android' ?
NativeModules.IntentAndroid : NativeModules.LinkingManager;
const LinkingManager =
Platform.OS === 'android'
? NativeModules.IntentAndroid
: NativeModules.LinkingManager;
/**
* `Linking` gives you a general interface to interact with both incoming
@@ -24,7 +28,6 @@ const LinkingManager = Platform.OS === 'android' ?
* See https://facebook.github.io/react-native/docs/linking.html
*/
class Linking extends NativeEventEmitter {
constructor() {
super(LinkingManager);
}
@@ -44,7 +47,7 @@ class Linking extends NativeEventEmitter {
*
* See https://facebook.github.io/react-native/docs/linking.html#removeeventlistener
*/
removeEventListener(type: string, handler: Function ) {
removeEventListener(type: string, handler: Function) {
this.removeListener(type, handler);
}
@@ -81,12 +84,9 @@ class Linking extends NativeEventEmitter {
_validateURL(url: string) {
invariant(
typeof url === 'string',
'Invalid URL: should be a string. Was: ' + url
);
invariant(
url,
'Invalid URL: cannot be empty'
'Invalid URL: should be a string. Was: ' + url,
);
invariant(url, 'Invalid URL: cannot be empty');
}
}