Update flow to 0.92.1 and fix related issues (#9468)
* Update flow to 0.92.1 and fix related issues * Change isThenable check
This commit is contained in:
@@ -43,7 +43,6 @@ export function makeWeakCache<
|
||||
>(
|
||||
handler: (ArgT, CacheConfigurator<SideChannel>) => ResultT,
|
||||
): (ArgT, SideChannel) => ResultT {
|
||||
// $FlowIssue https://github.com/facebook/flow/issues/4528
|
||||
return makeCachedFunction(new WeakMap(), handler);
|
||||
}
|
||||
|
||||
|
||||
@@ -10,7 +10,7 @@ import {
|
||||
makeWeakCache,
|
||||
type CacheConfigurator,
|
||||
} from "../caching";
|
||||
import makeAPI from "../helpers/config-api";
|
||||
import makeAPI, { type PluginAPI } from "../helpers/config-api";
|
||||
import { makeStaticFileCache } from "./utils";
|
||||
import pathPatternToRegex from "../pattern-to-regex";
|
||||
import type { FilePackageData, RelativeConfig, ConfigFile } from "./types";
|
||||
@@ -150,7 +150,7 @@ const LOADING_CONFIGS = new Set();
|
||||
|
||||
const readConfigJS = makeStrongCache(
|
||||
(
|
||||
filepath,
|
||||
filepath: string,
|
||||
cache: CacheConfigurator<{
|
||||
envName: string,
|
||||
caller: CallerMetadata | void,
|
||||
@@ -193,7 +193,7 @@ const readConfigJS = makeStrongCache(
|
||||
}
|
||||
|
||||
if (typeof options === "function") {
|
||||
options = options(makeAPI(cache));
|
||||
options = ((options: any): (api: PluginAPI) => {})(makeAPI(cache));
|
||||
|
||||
if (!cache.configured()) throwConfigError();
|
||||
}
|
||||
|
||||
@@ -131,6 +131,7 @@ function isThenable(val: mixed): boolean {
|
||||
return (
|
||||
!!val &&
|
||||
(typeof val === "object" || typeof val === "function") &&
|
||||
!!val.then &&
|
||||
typeof val.then === "function"
|
||||
);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user