diff --git a/lib/core.js b/lib/core.js index 1d6ce0c869f..6c746ffb2bb 100644 --- a/lib/core.js +++ b/lib/core.js @@ -2399,9 +2399,11 @@ declare var module: { id: string, filename: string, loaded: boolean, - parent: any, - children: Array, - builtinModules: Array, + parent?: typeof module, + children: typeof module[], + builtinModules: string[], + path: string; + paths: string[]; ... }; declare var require: { diff --git a/lib/node.js b/lib/node.js index 1666c72b0d0..cd06b875878 100644 --- a/lib/node.js +++ b/lib/node.js @@ -1654,6 +1654,59 @@ type net$connectOptions = { ... }; +declare module "module" { + declare class Module extends module { + constructor(id: string, parent?: typeof module): void; + globalPaths: string[]; + load(fileName: string): void; + syncBuiltinESMExports(): void; + + static runMain(): void; + static wrap(code: string): string; + + /** + * Deprecated since: v12.2.0. Please use createRequire() instead. + */ + static createRequireFromPath(path: string): (request: string) => {|[export: string]: any|}; + static createRequire(path: string | URL): (request: string) => {|[export: string]: any|}; + static _cache: {|[key: string]: Module|}; + static _pathCache: {|[cacheKey: string]: string|}; + static _nodeModulePaths(from: string): string[]; + static _initPaths(): void; + static findPnpApi(lookupSource: string): PnpApi | null; + + static _findPath( + request: string, + paths?: string[], + isMain?: boolean, + ): string | false; + + static _extensions: {| + [extension: string]: (module: Module, fileName: string) => void, + |}; + + static _resolveLookupPaths( + request: string, + parent?: Module, + ): string[] | null; + + static _load( + request: string, + parent?: Module, + isMain?: boolean, + ): {|[export: string]: any|}; + + static _resolveFilename: ( + request: string, + parent?: Module, + isMain?: boolean, + options?: {|paths?: string[]|}, + ) => string | false; + } + + declare module.exports: typeof Module; +} + declare module "net" { declare class Server extends net$Server {} diff --git a/tests/enums/enums.exp b/tests/enums/enums.exp index 7a1b732d60a..5fdf4b6f1ea 100644 --- a/tests/enums/enums.exp +++ b/tests/enums/enums.exp @@ -1240,8 +1240,8 @@ References: exhaustive-check.js:3:6 3| enum E { ^ [2] - /core.js:2449:3 - 2449| isValid(input: ?TRepresentation): boolean, + /core.js:2451:3 + 2451| isValid(input: ?TRepresentation): boolean, ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [3] @@ -1850,14 +1850,14 @@ Cannot get `E.nonExistent` because property `nonExistent` is missing in `$EnumPr ^^^^^^^^^^^ References: - /core.js:2447:43 + /core.js:2449:43 v- - 2447| type $EnumProto = {| - 2448| cast(input: ?TRepresentation): void | TEnum, - 2449| isValid(input: ?TRepresentation): boolean, - 2450| members(): Iterable, - 2451| __proto__: null, - 2452| |} + 2449| type $EnumProto = {| + 2450| cast(input: ?TRepresentation): void | TEnum, + 2451| isValid(input: ?TRepresentation): boolean, + 2452| members(): Iterable, + 2453| __proto__: null, + 2454| |} -^ [1] @@ -1870,14 +1870,14 @@ Cannot call `E.nonExistent` because property `nonExistent` is missing in `$EnumP ^^^^^^^^^^^ References: - /core.js:2447:43 + /core.js:2449:43 v- - 2447| type $EnumProto = {| - 2448| cast(input: ?TRepresentation): void | TEnum, - 2449| isValid(input: ?TRepresentation): boolean, - 2450| members(): Iterable, - 2451| __proto__: null, - 2452| |} + 2449| type $EnumProto = {| + 2450| cast(input: ?TRepresentation): void | TEnum, + 2451| isValid(input: ?TRepresentation): boolean, + 2452| members(): Iterable, + 2453| __proto__: null, + 2454| |} -^ [1] @@ -1904,14 +1904,14 @@ Cannot call `E.A` because property `A` is missing in `$EnumProto` [1]. [prop-mis ^ References: - /core.js:2447:43 + /core.js:2449:43 v- - 2447| type $EnumProto = {| - 2448| cast(input: ?TRepresentation): void | TEnum, - 2449| isValid(input: ?TRepresentation): boolean, - 2450| members(): Iterable, - 2451| __proto__: null, - 2452| |} + 2449| type $EnumProto = {| + 2450| cast(input: ?TRepresentation): void | TEnum, + 2451| isValid(input: ?TRepresentation): boolean, + 2452| members(): Iterable, + 2453| __proto__: null, + 2454| |} -^ [1] @@ -1924,14 +1924,14 @@ Cannot call `E.toString` because property `toString` is missing in `$EnumProto` ^^^^^^^^ References: - /core.js:2447:43 + /core.js:2449:43 v- - 2447| type $EnumProto = {| - 2448| cast(input: ?TRepresentation): void | TEnum, - 2449| isValid(input: ?TRepresentation): boolean, - 2450| members(): Iterable, - 2451| __proto__: null, - 2452| |} + 2449| type $EnumProto = {| + 2450| cast(input: ?TRepresentation): void | TEnum, + 2451| isValid(input: ?TRepresentation): boolean, + 2452| members(): Iterable, + 2453| __proto__: null, + 2454| |} -^ [1] diff --git a/tests/get_def_enums/get_def_enums.exp b/tests/get_def_enums/get_def_enums.exp index 8fac4defde7..414c05c77e4 100644 --- a/tests/get_def_enums/get_def_enums.exp +++ b/tests/get_def_enums/get_def_enums.exp @@ -24,9 +24,9 @@ library.js:4:3,4:5 main.js:23:13 Flags: -[LIB] core.js:2448:3,2448:6 +[LIB] core.js:2450:3,2450:6 main.js:26:13 Flags: -[LIB] core.js:2449:3,2449:9 +[LIB] core.js:2451:3,2451:9 diff --git a/tests/node_tests/module/module.js b/tests/node_tests/module/module.js new file mode 100644 index 00000000000..5c76f4774fb --- /dev/null +++ b/tests/node_tests/module/module.js @@ -0,0 +1,36 @@ +/* @flow */ + +const Module = require('module'); + +const myModule = new Module('foo'); +const invalidModule = new Module(1); // error + +// Instance methods +myModule.globalPaths = ['/xyz', '/abc']; +myModule.globalPaths = [1]; // error + +myModule.load('bar.js'); +(myModule.load('a.js'): Module); // error + +// Static methods +Module._cache = {a: myModule, b: new Module('baz')}; +Module._cache = {a: 123}; // error + +Module._findPath('a', ['./bcd', '../xyz']); +Module._findPath('a', '/bcd'); // error + +let paths = Module._resolveLookupPaths('foo'); + +if (paths) { + (paths: string[]); +} else { + (paths: null); +}; + +(Module._load('file.js'): {}); +(Module._load('file.js'): {[export: string]: () => {}}); + +Module._resolveFilename('foo.js', 'bar'); // error +let filename = Module._resolveFilename('foo.js', myModule); + +(filename: boolean); // error diff --git a/tests/node_tests/node_tests.exp b/tests/node_tests/node_tests.exp index 4e7000f1c72..7c3cbd43c6f 100644 --- a/tests/node_tests/node_tests.exp +++ b/tests/node_tests/node_tests.exp @@ -47,8 +47,8 @@ Cannot cast `hmac.read()` to number because null or undefined [1] is incompatibl ^^^^^^^^^^^ References: - /node.js:1876:24 - 1876| read(size?: number): ?(string | Buffer); + /node.js:1929:24 + 1929| read(size?: number): ?(string | Buffer); ^^^^^^^^^^^^^^^^^^ [1] crypto/crypto.js:12:21 12| (hmac.read(): number); // 4 errors: null, void, string, Buffer @@ -64,8 +64,8 @@ Cannot cast `hmac.read()` to number because string [1] is incompatible with numb ^^^^^^^^^^^ References: - /node.js:1876:26 - 1876| read(size?: number): ?(string | Buffer); + /node.js:1929:26 + 1929| read(size?: number): ?(string | Buffer); ^^^^^^ [1] crypto/crypto.js:12:21 12| (hmac.read(): number); // 4 errors: null, void, string, Buffer @@ -81,8 +81,8 @@ Cannot cast `hmac.read()` to number because `Buffer` [1] is incompatible with nu ^^^^^^^^^^^ References: - /node.js:1876:35 - 1876| read(size?: number): ?(string | Buffer); + /node.js:1929:35 + 1929| read(size?: number): ?(string | Buffer); ^^^^^^ [1] crypto/crypto.js:12:21 12| (hmac.read(): number); // 4 errors: null, void, string, Buffer @@ -103,11 +103,11 @@ References: crypto/crypto.js:16:16 16| hmac.write(123); // 2 errors: not a string or a Buffer ^^^ [1] - /node.js:1920:16 - 1920| write(chunk: string | Buffer | Uint8Array, callback?: (error?: Error) => void): boolean; + /node.js:1973:16 + 1973| write(chunk: string | Buffer | Uint8Array, callback?: (error?: Error) => void): boolean; ^^^^^^ [2] - /node.js:1921:16 - 1921| write(chunk: string | Buffer | Uint8Array, encoding?: string, callback?: (error?: Error) => void): boolean; + /node.js:1974:16 + 1974| write(chunk: string | Buffer | Uint8Array, encoding?: string, callback?: (error?: Error) => void): boolean; ^^^^^^ [3] @@ -1532,6 +1532,115 @@ Unexpected end of input, expected a valid JSON value +Error -------------------------------------------------------------------------------------------- module/module.js:6:34 + +Cannot call `Module` with `1` bound to `id` because number [1] is incompatible with string [2]. [incompatible-call] + + module/module.js:6:34 + 6| const invalidModule = new Module(1); // error + ^ [1] + +References: + /node.js:1659:21 + 1659| constructor(id: string, parent?: typeof module): void; + ^^^^^^ [2] + + +Error ------------------------------------------------------------------------------------------- module/module.js:10:25 + +Cannot assign array literal to `myModule.globalPaths` because number [1] is incompatible with string [2] in array +element. [incompatible-type] + + module/module.js:10:25 + 10| myModule.globalPaths = [1]; // error + ^ [1] + +References: + /node.js:1660:18 + 1660| globalPaths: string[]; + ^^^^^^ [2] + + +Error -------------------------------------------------------------------------------------------- module/module.js:13:2 + +Cannot cast `myModule.load(...)` to `Module` because undefined [1] is incompatible with `Module` [2]. +[incompatible-cast] + + module/module.js:13:2 + 13| (myModule.load('a.js'): Module); // error + ^^^^^^^^^^^^^^^^^^^^^ + +References: + /node.js:1661:29 + 1661| load(fileName: string): void; + ^^^^ [1] + module/module.js:13:25 + 13| (myModule.load('a.js'): Module); // error + ^^^^^^ [2] + + +Error ------------------------------------------------------------------------------------------- module/module.js:17:21 + +Cannot assign object literal to `Module._cache` because number [1] is incompatible with `Module` [2] in property `a`. +[incompatible-type] + + module/module.js:17:21 + 17| Module._cache = {a: 123}; // error + ^^^ [1] + +References: + /node.js:1672:37 + 1672| static _cache: {|[key: string]: Module|}; + ^^^^^^ [2] + + +Error ------------------------------------------------------------------------------------------- module/module.js:20:23 + +Cannot call `Module._findPath` with `'/bcd'` bound to `paths` because string [1] is incompatible with array type [2]. +[incompatible-call] + + module/module.js:20:23 + 20| Module._findPath('a', '/bcd'); // error + ^^^^^^ [1] + +References: + /node.js:1680:15 + 1680| paths?: string[], + ^^^^^^^^ [2] + + +Error ------------------------------------------------------------------------------------------- module/module.js:33:35 + +Cannot call `Module._resolveFilename` with `'bar'` bound to `parent` because string [1] is incompatible with +`Module` [2]. [incompatible-call] + + module/module.js:33:35 + 33| Module._resolveFilename('foo.js', 'bar'); // error + ^^^^^ [1] + +References: + /node.js:1701:16 + 1701| parent?: Module, + ^^^^^^ [2] + + +Error -------------------------------------------------------------------------------------------- module/module.js:36:2 + +Cannot cast `filename` to boolean because string [1] is incompatible with boolean [2]. [incompatible-cast] + + module/module.js:36:2 + 36| (filename: boolean); // error + ^^^^^^^^ + +References: + /node.js:1704:10 + 1704| ) => string | false; + ^^^^^^ [1] + module/module.js:36:12 + 36| (filename: boolean); // error + ^^^^^^^ [2] + + Error ----------------------------------------------------------------------------------------------- os/userInfo.js:7:2 Cannot cast `u1.username` to `Buffer` because string [1] is incompatible with `Buffer` [2]. [incompatible-cast] @@ -1541,8 +1650,8 @@ Cannot cast `u1.username` to `Buffer` because string [1] is incompatible with `B ^^^^^^^^^^^ References: - /node.js:1726:13 - 1726| username: string, + /node.js:1779:13 + 1779| username: string, ^^^^^^ [1] os/userInfo.js:7:15 7| (u1.username: Buffer); // error @@ -1558,8 +1667,8 @@ Cannot cast `u2.username` to `Buffer` because string [1] is incompatible with `B ^^^^^^^^^^^ References: - /node.js:1726:13 - 1726| username: string, + /node.js:1779:13 + 1779| username: string, ^^^^^^ [1] os/userInfo.js:11:15 11| (u2.username: Buffer); // error @@ -1575,8 +1684,8 @@ Cannot cast `u3.username` to string because `Buffer` [1] is incompatible with st ^^^^^^^^^^^ References: - /node.js:1717:13 - 1717| username: Buffer, + /node.js:1770:13 + 1770| username: Buffer, ^^^^^^ [1] os/userInfo.js:14:15 14| (u3.username: string); // error @@ -1600,26 +1709,26 @@ References: process/emitWarning.js:10:1 10| process.emitWarning(); // error ^^^^^^^^^^^^^^^^^^^^^ [1] - /node.js:2632:24 - 2632| emitWarning(warning: string | Error): void; + /node.js:2685:24 + 2685| emitWarning(warning: string | Error): void; ^^^^^^ [2] - /node.js:2632:33 - 2632| emitWarning(warning: string | Error): void; + /node.js:2685:33 + 2685| emitWarning(warning: string | Error): void; ^^^^^ [3] - /node.js:2633:3 - 2633| emitWarning(warning: string, typeOrCtor: string | (...empty) => mixed): void; + /node.js:2686:3 + 2686| emitWarning(warning: string, typeOrCtor: string | (...empty) => mixed): void; ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [4] - /node.js:2634:3 - 2634| emitWarning(warning: string, type: string, codeOrCtor: string | (...empty) => mixed): void; + /node.js:2687:3 + 2687| emitWarning(warning: string, type: string, codeOrCtor: string | (...empty) => mixed): void; ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [5] - /node.js:2635:3 + /node.js:2688:3 v----------- - 2635| emitWarning( - 2636| warning: string, - 2637| type: string, - 2638| code: string, - 2639| ctor?: (...empty) => mixed - 2640| ): void; + 2688| emitWarning( + 2689| warning: string, + 2690| type: string, + 2691| code: string, + 2692| ctor?: (...empty) => mixed + 2693| ): void; ------^ [6] @@ -1638,14 +1747,14 @@ References: process/emitWarning.js:11:21 11| process.emitWarning(42); // error ^^ [1] - /node.js:2633:24 - 2633| emitWarning(warning: string, typeOrCtor: string | (...empty) => mixed): void; + /node.js:2686:24 + 2686| emitWarning(warning: string, typeOrCtor: string | (...empty) => mixed): void; ^^^^^^ [2] - /node.js:2634:24 - 2634| emitWarning(warning: string, type: string, codeOrCtor: string | (...empty) => mixed): void; + /node.js:2687:24 + 2687| emitWarning(warning: string, type: string, codeOrCtor: string | (...empty) => mixed): void; ^^^^^^ [3] - /node.js:2636:14 - 2636| warning: string, + /node.js:2689:14 + 2689| warning: string, ^^^^^^ [4] @@ -1663,11 +1772,11 @@ References: process/emitWarning.js:12:29 12| process.emitWarning("blah", 42); // error ^^ [1] - /node.js:2634:38 - 2634| emitWarning(warning: string, type: string, codeOrCtor: string | (...empty) => mixed): void; + /node.js:2687:38 + 2687| emitWarning(warning: string, type: string, codeOrCtor: string | (...empty) => mixed): void; ^^^^^^ [2] - /node.js:2637:11 - 2637| type: string, + /node.js:2690:11 + 2690| type: string, ^^^^^^ [3] @@ -1683,8 +1792,8 @@ References: process/emitWarning.js:13:37 13| process.emitWarning("blah", "blah", 42); // error ^^ [1] - /node.js:2638:11 - 2638| code: string, + /node.js:2691:11 + 2691| code: string, ^^^^^^ [2] @@ -1698,8 +1807,8 @@ Cannot cast `process.emitWarning(...)` to string because undefined [1] is incomp ^^^^^^^^^^^^^^^^^^^^^^^^^^^ References: - /node.js:2632:41 - 2632| emitWarning(warning: string | Error): void; + /node.js:2685:41 + 2685| emitWarning(warning: string | Error): void; ^^^^ [1] process/emitWarning.js:14:31 14| (process.emitWarning("blah"): string); // error @@ -1764,8 +1873,8 @@ References: process/nextTick.js:27:3 27| (a: string, b: number, c: boolean) => {} // Error: too few arguments ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [1] - /node.js:2661:21 - 2661| nextTick: (cb: (...T) => mixed, ...T) => void; + /node.js:2714:21 + 2714| nextTick: (cb: (...T) => mixed, ...T) => void; ^^^^^^^^^^^^^^^ [2] @@ -1779,8 +1888,8 @@ Cannot cast `process.allowedNodeEnvironmentFlags` to string because `Set` [1] is ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ References: - /node.js:2621:32 - 2621| allowedNodeEnvironmentFlags: Set; + /node.js:2674:32 + 2674| allowedNodeEnvironmentFlags: Set; ^^^^^^^^^^^ [1] process/process.js:5:39 5| (process.allowedNodeEnvironmentFlags: string); // error @@ -1813,8 +1922,8 @@ Cannot cast `error` to null because `Error` [1] is incompatible with null [2]. [ ^^^^^ References: - /node.js:2004:18 - 2004| cb: (error?: Error) => void, + /node.js:2057:18 + 2057| cb: (error?: Error) => void, ^^^^^ [1] stream/stream.js:45:13 45| (error: null); // error @@ -1830,8 +1939,8 @@ Cannot cast `error` to null because undefined [1] is incompatible with null [2]. ^^^^^ References: - /node.js:2004:18 - 2004| cb: (error?: Error) => void, + /node.js:2057:18 + 2057| cb: (error?: Error) => void, ^^^^^ [1] stream/stream.js:45:13 45| (error: null); // error @@ -1874,23 +1983,23 @@ References: stream/stream.js:53:3 53| new MyWriteStream(), // error - first stream must be Readable ^^^^^^^^^^^^^^^^^^^ [1] - /node.js:1989:9 - 1989| s1: stream$Readable, + /node.js:2042:9 + 2042| s1: stream$Readable, ^^^^^^^^^^^^^^^ [2] - /node.js:1994:9 - 1994| s1: stream$Readable, + /node.js:2047:9 + 2047| s1: stream$Readable, ^^^^^^^^^^^^^^^ [3] - /node.js:2000:9 - 2000| s1: stream$Readable, + /node.js:2053:9 + 2053| s1: stream$Readable, ^^^^^^^^^^^^^^^ [4] - /node.js:2007:9 - 2007| s1: stream$Readable, + /node.js:2060:9 + 2060| s1: stream$Readable, ^^^^^^^^^^^^^^^ [5] - /node.js:2015:9 - 2015| s1: stream$Readable, + /node.js:2068:9 + 2068| s1: stream$Readable, ^^^^^^^^^^^^^^^ [6] - /node.js:2024:9 - 2024| s1: stream$Readable, + /node.js:2077:9 + 2077| s1: stream$Readable, ^^^^^^^^^^^^^^^ [7] @@ -1911,20 +2020,20 @@ References: stream/stream.js:60:3 60| new MyWriteStream(), // error - middle stream must be Duplex ^^^^^^^^^^^^^^^^^^^ [1] - /node.js:1995:9 - 1995| s2: stream$Duplex, + /node.js:2048:9 + 2048| s2: stream$Duplex, ^^^^^^^^^^^^^ [2] - /node.js:2001:9 - 2001| s2: stream$Duplex, + /node.js:2054:9 + 2054| s2: stream$Duplex, ^^^^^^^^^^^^^ [3] - /node.js:2008:9 - 2008| s2: stream$Duplex, + /node.js:2061:9 + 2061| s2: stream$Duplex, ^^^^^^^^^^^^^ [4] - /node.js:2016:9 - 2016| s2: stream$Duplex, + /node.js:2069:9 + 2069| s2: stream$Duplex, ^^^^^^^^^^^^^ [5] - /node.js:2025:9 - 2025| s2: stream$Duplex, + /node.js:2078:9 + 2078| s2: stream$Duplex, ^^^^^^^^^^^^^ [6] @@ -1945,20 +2054,20 @@ References: stream/stream.js:68:3 68| new MyReadStream(), // error - last stream must be Writable ^^^^^^^^^^^^^^^^^^ [1] - /node.js:1993:32 - 1993| declare function pipeline( + /node.js:2046:32 + 2046| declare function pipeline( ^^^^^^^^^^^^^^^ [2] - /node.js:2002:9 - 2002| s3: stream$Duplex, + /node.js:2055:9 + 2055| s3: stream$Duplex, ^^^^^^^^^^^^^ [3] - /node.js:2009:9 - 2009| s3: stream$Duplex, + /node.js:2062:9 + 2062| s3: stream$Duplex, ^^^^^^^^^^^^^ [4] - /node.js:2017:9 - 2017| s3: stream$Duplex, + /node.js:2070:9 + 2070| s3: stream$Duplex, ^^^^^^^^^^^^^ [5] - /node.js:2026:9 - 2026| s3: stream$Duplex, + /node.js:2079:9 + 2079| s3: stream$Duplex, ^^^^^^^^^^^^^ [6] @@ -1971,8 +2080,8 @@ Cannot cast `url.parse(...).query` to empty because string [1] is incompatible w ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ References: - /node.js:2200:12 - 2200| query: string | null + /node.js:2253:12 + 2253| query: string | null ^^^^^^ [1] url/url.js:4:50 4| (url.parse('http://example.com/?foo=bar').query: empty); // error, string | null @@ -1988,8 +2097,8 @@ Cannot cast `url.parse(...).query` to empty because null [1] is incompatible wit ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ References: - /node.js:2200:21 - 2200| query: string | null + /node.js:2253:21 + 2253| query: string | null ^^^^ [1] url/url.js:4:50 4| (url.parse('http://example.com/?foo=bar').query: empty); // error, string | null @@ -2005,8 +2114,8 @@ Cannot cast `url.parse(...).query` to empty because object type [1] is incompati ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ References: - /node.js:2205:12 - 2205| query: { [string]: string, ... } + /node.js:2258:12 + 2258| query: { [string]: string, ... } ^^^^^^^^^^^^^^^^^^^^^^^^^ [1] url/url.js:5:56 5| (url.parse('http://example.com/?foo=bar', true).query: empty); // error, object @@ -2022,8 +2131,8 @@ Cannot cast `url.parse(...).query` to empty because string [1] is incompatible w ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ References: - /node.js:2192:12 - 2192| query: string | null | { [string]: string, ... }, + /node.js:2245:12 + 2245| query: string | null | { [string]: string, ... }, ^^^^^^ [1] url/url.js:8:70 8| (url.parse('http://example.com/?foo=bar', parseQueryString).query: empty); // error, string | null | object @@ -2039,8 +2148,8 @@ Cannot cast `url.parse(...).query` to empty because null [1] is incompatible wit ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ References: - /node.js:2192:21 - 2192| query: string | null | { [string]: string, ... }, + /node.js:2245:21 + 2245| query: string | null | { [string]: string, ... }, ^^^^ [1] url/url.js:8:70 8| (url.parse('http://example.com/?foo=bar', parseQueryString).query: empty); // error, string | null | object @@ -2056,8 +2165,8 @@ Cannot cast `url.parse(...).query` to empty because object type [1] is incompati ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ References: - /node.js:2192:28 - 2192| query: string | null | { [string]: string, ... }, + /node.js:2245:28 + 2245| query: string | null | { [string]: string, ... }, ^^^^^^^^^^^^^^^^^^^^^^^^^ [1] url/url.js:8:70 8| (url.parse('http://example.com/?foo=bar', parseQueryString).query: empty); // error, string | null | object @@ -2065,7 +2174,7 @@ References: -Found 108 errors +Found 115 errors Only showing the most relevant union/intersection branches. To see all branches, re-run Flow with --show-all-branches