Skip to content

Commit a00bf9e

Browse files
Fix flow
1 parent 93ca9c8 commit a00bf9e

1 file changed

Lines changed: 5 additions & 1 deletion

File tree

  • packages/babel-core/src/config

packages/babel-core/src/config/item.js

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
// @flow
22

3+
/*:: declare var invariant; */
4+
35
import type { PluginTarget, PluginOptions } from "./validation/options";
46

57
import path from "path";
@@ -40,7 +42,8 @@ export function createConfigItem(
4042
}
4143

4244
export function getItemDescriptor(item: mixed): UnloadedDescriptor | void {
43-
if (item?.[CONFIG_ITEM_BRAND]) {
45+
if ((item: any)?.[CONFIG_ITEM_BRAND]) {
46+
/*:: invariant(item instanceof ConfigItem) */
4447
return item._descriptor;
4548
}
4649

@@ -70,6 +73,7 @@ class ConfigItem {
7073
/**
7174
* Used to detect ConfigItem instances from other Babel instances.
7275
*/
76+
// $FlowIgnore
7377
[CONFIG_ITEM_BRAND] = true;
7478

7579
/**

0 commit comments

Comments
 (0)