Skip to content

Commit dc98350

Browse files
committed
Fix flow types
1 parent b4d3733 commit dc98350

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

scripts/build-flow.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,9 +5,10 @@ let index = fs.readFileSync(dir + '/node/index.d.ts', 'utf8');
55
index = '// @flow\n' + index;
66
index = index.replace(/export interface (.*?) \{((?:.|\n)*?)\}/g, 'export type $1 = {|$2|};');
77
index = index.replace(/export declare function/g, 'declare export function');
8+
index = index.replace("Omit<TransformOptions, 'code'>", "$Rest<TransformOptions, {|code: TransformOptions['code']|}>");
89

910
let targets = fs.readFileSync(dir + '/node/targets.d.ts', 'utf8');
1011
targets = targets.replace(/export interface (.*?) \{((?:.|\n)*?)\}/g, 'export type $1 = {|$2|};');
11-
index = index.replace("import type {Targets} from './targets';", targets);
12+
index = index.replace(/import type \{\s*Targets\s*\} from '.\/targets';/, targets);
1213

1314
fs.writeFileSync(dir + '/node/index.js.flow', index);

0 commit comments

Comments
 (0)