Skip to content

Commit 33130d8

Browse files
committed
Fix flow build
1 parent 6791ff3 commit 33130d8

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

scripts/build-flow.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ const fs = require('fs');
33
let dir = `${__dirname}/../`;
44
let index = fs.readFileSync(dir + '/node/index.d.ts', 'utf8');
55
index = '// @flow\n' + index;
6-
index = index.replace(/export interface (.*?) \{((?:.|\n)*?)\}/g, 'export type $1 = {|$2|};');
6+
index = index.replace(/export interface (.*?)(?: extends (.+?))? \{((?:.|\n)*?)\}/g, (_, name, ext, contents) => `export type ${name} =${ext ? ` ${ext} &` : ''} {|${contents}|};`);
77
index = index.replace(/export declare function/g, 'declare export function');
88
index = index.replace("Omit<TransformOptions, 'code'>", "$Rest<TransformOptions, {|code: TransformOptions['code']|}>");
99

0 commit comments

Comments
 (0)