Remove pipes from Object literal Flow types

Summary:
## Changes
{| ... |} -> { ... }

**Motivation:** In Flow, object literals are exact by default. So, there's no need for the pipes. Also: Now, the syntax for object literals is consistent across react-native-codegen.

Changelog: [Internal]

Reviewed By: hramos

Differential Revision: D24774771

fbshipit-source-id: 24ceb6f5876122aa8ad9e08c7e903215864ad6f5
This commit is contained in:
Ramanpreet Nara
2020-11-06 16:24:44 -08:00
committed by Facebook GitHub Bot
parent cb7f3f4499
commit 00cfb0f919
21 changed files with 195 additions and 199 deletions
@@ -27,12 +27,12 @@ const {unwrapNullable} = require('../../parsers/flow/modules/utils');
type FilesOutput = Map<string, string>;
function FileTemplate(
config: $ReadOnly<{|
config: $ReadOnly<{
packageName: string,
className: string,
methods: string,
imports: string,
|}>,
}>,
): string {
const {packageName, className, methods, imports} = config;
return `
@@ -62,14 +62,14 @@ ${methods}
}
function MethodTemplate(
config: $ReadOnly<{|
config: $ReadOnly<{
abstract: boolean,
methodBody: ?string,
methodJavaAnnotation: string,
methodName: string,
translatedReturnType: string,
traversedArgs: Array<string>,
|}>,
}>,
): string {
const {
abstract,