Merge pull request #832 from skovhus/correct-flow-string-types

Flow: Use literal values for strings
This commit is contained in:
chrisbianca 2018-02-15 08:11:33 +00:00 committed by GitHub
commit 7be16a4429
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 5 additions and 5 deletions

View File

@ -123,7 +123,7 @@ export default class RemoteConfig extends ModuleBase {
* "source" : OneOf<String>(remoteConfigSourceRemote|remoteConfigSourceDefault|remoteConfigSourceStatic) * "source" : OneOf<String>(remoteConfigSourceRemote|remoteConfigSourceDefault|remoteConfigSourceStatic)
* } * }
*/ */
getValue(key: String) { getValue(key: string) {
return getNativeModule(this) return getNativeModule(this)
.getValue(key || '') .getValue(key || '')
.then(this._nativeValueToJS); .then(this._nativeValueToJS);
@ -160,7 +160,7 @@ export default class RemoteConfig extends ModuleBase {
* @param prefix: The key prefix to look for. If prefix is nil or empty, returns all the keys. * @param prefix: The key prefix to look for. If prefix is nil or empty, returns all the keys.
* @returns {*|Promise.<Array<String>>} * @returns {*|Promise.<Array<String>>}
*/ */
getKeysByPrefix(prefix?: String) { getKeysByPrefix(prefix?: string) {
return getNativeModule(this).getKeysByPrefix(prefix); return getNativeModule(this).getKeysByPrefix(prefix);
} }
@ -176,7 +176,7 @@ export default class RemoteConfig extends ModuleBase {
* Sets default configs from plist for default namespace; * Sets default configs from plist for default namespace;
* @param resource: The plist file name or resource ID * @param resource: The plist file name or resource ID
*/ */
setDefaultsFromResource(resource: String | number) { setDefaultsFromResource(resource: string | number) {
getNativeModule(this).setDefaultsFromResource(resource); getNativeModule(this).setDefaultsFromResource(resource);
} }
} }

View File

@ -201,7 +201,7 @@ class EventEmitter {
* }); // removes the listener if already registered * }); // removes the listener if already registered
* *
*/ */
removeListener(eventType: String, listener) { removeListener(eventType: string, listener) {
const subscriptions: ?[EmitterSubscription] = (this._subscriber.getSubscriptionsForType(eventType): any); const subscriptions: ?[EmitterSubscription] = (this._subscriber.getSubscriptionsForType(eventType): any);
if (subscriptions) { if (subscriptions) {
for (let i = 0, l = subscriptions.length; i < l; i++) { for (let i = 0, l = subscriptions.length; i < l; i++) {

View File

@ -282,7 +282,7 @@ export function typeOf(value: any): string {
// * @param string // * @param string
// * @return {string} // * @return {string}
// */ // */
// export function capitalizeFirstLetter(string: String) { // export function capitalizeFirstLetter(string: string) {
// return `${string.charAt(0).toUpperCase()}${string.slice(1)}`; // return `${string.charAt(0).toUpperCase()}${string.slice(1)}`;
// } // }