Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions packages/metro-file-map/src/watchers/__tests__/helpers.js
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ export type EventHelpers = {
nextEvent: (afterFn: () => Promise<void>) => Promise<{
eventType: string,
path: string,
metadata?: ChangeEventMetadata,
metadata?: ChangeEventMetadata | void,
}>,
untilEvent: (
afterFn: () => Promise<void>,
Expand Down Expand Up @@ -150,7 +150,7 @@ export const startWatching = async (
Promise.all([
new Promise<{
eventType: string,
metadata?: ChangeEventMetadata,
metadata?: ChangeEventMetadata | void,
path: string,
}>((resolve, reject) => {
const unsubscribe: () => void = watcherInstance.onFileEvent(
Expand Down
1 change: 1 addition & 0 deletions packages/metro/src/DeltaBundler/Transformer.js
Original file line number Diff line number Diff line change
Expand Up @@ -274,6 +274,7 @@ export default class Transformer {
this._workerFarm.transform(
projectRelativePath,
transformerOptions,
// $FlowFixMe[incompatible-type] `void` is not `undefined` under experimental.ts_void
content,
assetUrlPath ?? undefined,
);
Expand Down
2 changes: 1 addition & 1 deletion packages/metro/src/DeltaBundler/__tests__/resolver-test.js
Original file line number Diff line number Diff line change
Expand Up @@ -125,7 +125,7 @@ function dep(name: string): TransformResultDependency {
from: string,
dependency: TransformResultDependency,
resolverOptions?: ResolverInputOptions = {dev: true},
options: void | {assumeFlatNodeModules: boolean},
options?: {assumeFlatNodeModules: boolean},
) =>
dependencyGraph.resolveDependency(
from,
Expand Down
1 change: 1 addition & 0 deletions packages/metro/src/index.flow.js
Original file line number Diff line number Diff line change
Expand Up @@ -593,6 +593,7 @@ async function earlyPortCheck(host: void | string, port: number) {
server.on('error', err => {
reject(err);
});
// $FlowFixMe[incompatible-type] `void` is not `undefined` under experimental.ts_void
server.listen(port, host, undefined, () => resolve());
});
} finally {
Expand Down
4 changes: 2 additions & 2 deletions packages/metro/src/shared/output/RamBundle/as-assets.js
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@ function createDir(dirName: string): Promise<void> {
function writeModuleFile(
module: ModuleTransportLike,
modulesDir: string,
encoding: void | 'ascii' | 'utf16le' | 'utf8',
encoding?: 'ascii' | 'utf16le' | 'utf8',
): Promise<unknown> {
const {code, id} = module;
return writeFile(path.join(modulesDir, id + '.js'), code, encoding);
Expand All @@ -102,7 +102,7 @@ function writeModuleFile(
function writeModules(
modules: ReadonlyArray<ModuleTransportLike>,
modulesDir: string,
encoding: void | 'ascii' | 'utf16le' | 'utf8',
encoding?: 'ascii' | 'utf16le' | 'utf8',
): Promise<Array<unknown>> {
const writeFiles = modules.map(
(module: ModuleTransportLike): Promise<unknown> =>
Expand Down
6 changes: 3 additions & 3 deletions packages/metro/src/shared/output/RamBundle/as-indexed-file.js
Original file line number Diff line number Diff line change
Expand Up @@ -101,15 +101,15 @@ function writeBuffers(

function nullTerminatedBuffer(
contents: string,
encoding: void | 'ascii' | 'utf16le' | 'utf8',
encoding?: 'ascii' | 'utf16le' | 'utf8',
): Buffer {
return Buffer.concat([Buffer.from(contents, encoding), nullByteBuffer]);
}

function moduleToBuffer(
id: number,
code: string,
encoding: void | 'ascii' | 'utf16le' | 'utf8',
encoding?: 'ascii' | 'utf16le' | 'utf8',
): {buffer: Buffer, id: number} {
return {
id,
Expand Down Expand Up @@ -194,7 +194,7 @@ function groupCode(
function buildModuleBuffers(
modules: ReadonlyArray<ModuleTransportLike>,
moduleGroups: ModuleGroups,
encoding: void | 'ascii' | 'utf16le' | 'utf8',
encoding?: 'ascii' | 'utf16le' | 'utf8',
): Array<{
buffer: Buffer,
id: number,
Expand Down
2 changes: 1 addition & 1 deletion packages/metro/src/shared/output/bundle.flow.js
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ export async function save(
},
options: OutputOptions,
log: (message: string) => void,
): Promise<unknown> {
): Promise<void> {
const {
bundleOutput,
bundleEncoding: encoding,
Expand Down
Loading