From 7d92dd2b5d5d95473d447edf7029a7fca0a2f512 Mon Sep 17 00:00:00 2001 From: Jean Lauliac Date: Wed, 20 Sep 2017 09:18:30 -0700 Subject: [PATCH] RN buck: fix Flow error Reviewed By: davidaurelio Differential Revision: D5871509 fbshipit-source-id: 91bd020b95d33a854b5649daea1a0b8d7782706d --- packages/metro-bundler/src/ModuleGraph/worker.js | 2 +- .../src/ModuleGraph/worker/transform-module.js | 10 +++++----- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/packages/metro-bundler/src/ModuleGraph/worker.js b/packages/metro-bundler/src/ModuleGraph/worker.js index 906f39fd..ec1635c4 100644 --- a/packages/metro-bundler/src/ModuleGraph/worker.js +++ b/packages/metro-bundler/src/ModuleGraph/worker.js @@ -21,4 +21,4 @@ import type {WorkerFnWithIO} from './worker/wrap-worker-fn'; exports.optimizeModule = (wrapWorkerFn(optimizeModule): WorkerFnWithIO); exports.transformModule = - (wrapWorkerFn(transformModule): WorkerFnWithIO); + (wrapWorkerFn(transformModule): WorkerFnWithIO>); diff --git a/packages/metro-bundler/src/ModuleGraph/worker/transform-module.js b/packages/metro-bundler/src/ModuleGraph/worker/transform-module.js index 81be5da8..809ba72c 100644 --- a/packages/metro-bundler/src/ModuleGraph/worker/transform-module.js +++ b/packages/metro-bundler/src/ModuleGraph/worker/transform-module.js @@ -33,11 +33,11 @@ import type { } from '../types.flow'; import type {Ast} from 'babel-core'; -export type TransformOptions = {| +export type TransformOptions = {| filename: string, hasteImpl?: HasteImpl, polyfill?: boolean, - transformer: Transformer<*>, + transformer: Transformer, variants?: TransformVariants, |}; @@ -56,7 +56,7 @@ const ASSET_EXTENSIONS = new Set(defaults.assetExts); function transformModule( content: Buffer, - options: TransformOptions, + options: TransformOptions<{+retainLines?: boolean}>, ): TransformedSourceFile { if (ASSET_EXTENSIONS.has(path.extname(options.filename).substr(1))) { return transformAsset(content, options); @@ -143,9 +143,9 @@ function transformJSON(json, options): TransformedSourceFile { return {type: 'code', details: result}; } -function transformAsset( +function transformAsset( content: Buffer, - options: TransformOptions, + options: TransformOptions, ): TransformedSourceFile { return { details: {