Annotate Array.map returns when the implicit return type is widened

Summary: Changelog: [Internal]

Differential Revision: D40840078

fbshipit-source-id: 0104444060d8d6a1a22066d63579ac06ff715226
This commit is contained in:
Sam Zhou
2022-11-01 13:37:03 -07:00
committed by Facebook GitHub Bot
parent cfe811ab18
commit dbb9252d28
4 changed files with 13 additions and 9 deletions
@@ -50,7 +50,7 @@ function getLogBoxSymbolication(): {|
}
const createStack = (methodNames: Array<string>) =>
methodNames.map(methodName => ({
methodNames.map((methodName): StackFrame => ({
column: null,
file: 'file://path/to/file.js',
lineNumber: 1,
@@ -24,7 +24,7 @@ const symbolicateStackTrace: JestMockFn<
> = (require('../../../Core/Devtools/symbolicateStackTrace'): any);
const createStack = (methodNames: Array<string>) =>
methodNames.map(methodName => ({
methodNames.map((methodName): StackFrame => ({
column: null,
file: 'file://path/to/file.js',
lineNumber: 1,
@@ -9,6 +9,8 @@
* @oncall react_native
*/
import type {StackFrame} from '../../../Core/NativeExceptionsManager';
import LogBoxInspectorStackFrames, {
getCollapseMessage,
} from '../LogBoxInspectorStackFrames';
@@ -33,7 +35,7 @@ const createLogWithFrames = (collapsedOptions: Array<?boolean>) => {
};
const createCollapsedFrames = (collapsedOptions: Array<?boolean>) => {
return collapsedOptions.map(option => ({
return collapsedOptions.map((option): StackFrame => ({
column: 1,
file: 'dependency.js',
lineNumber: 1,
@@ -62,11 +62,13 @@ export const getExamplesListWithBookmarksAndRecentlyUsed = ({
return null;
}
const components = RNTesterList.Components.map(componentExample => ({
...componentExample,
isBookmarked: bookmarks.components.includes(componentExample.key),
exampleType: Screens.COMPONENTS,
}));
const components = RNTesterList.Components.map(
(componentExample): RNTesterModuleInfo => ({
...componentExample,
isBookmarked: bookmarks.components.includes(componentExample.key),
exampleType: Screens.COMPONENTS,
}),
);
const recentlyUsedComponents = recentlyUsed.components
.map(recentComponentKey =>
@@ -78,7 +80,7 @@ export const getExamplesListWithBookmarksAndRecentlyUsed = ({
component => component.isBookmarked,
);
const apis = RNTesterList.APIs.map(apiExample => ({
const apis = RNTesterList.APIs.map((apiExample): RNTesterModuleInfo => ({
...apiExample,
isBookmarked: bookmarks.apis.includes(apiExample.key),
exampleType: Screens.APIS,