File tree Expand file tree Collapse file tree 2 files changed +12
-6
lines changed Expand file tree Collapse file tree 2 files changed +12
-6
lines changed Original file line number Diff line number Diff line change @@ -12,7 +12,10 @@ import { version } from "../../package.json";
1212
1313type GetCodeFn = ( loc : t . SourceLocation ) => string ;
1414
15- const babelPluginUntyped : PluginItem = function ( api : ConfigAPI ) {
15+ const babelPluginUntyped : PluginItem = function (
16+ api : ConfigAPI ,
17+ options : { experimentalFunctions ?: boolean }
18+ ) {
1619 api . cache . using ( ( ) => version ) ;
1720
1821 return < PluginObj > {
@@ -89,10 +92,13 @@ const babelPluginUntyped: PluginItem = function (api: ConfigAPI) {
8992 schema . type = "function" ;
9093 schema . args = [ ] ;
9194
92- // TODO: Check for possible external regressions and only opt-in for loader if any
93- // if (!schema.tags.includes("@untyped")) {
94- // return;
95- // }
95+ // Experimental functions meta support
96+ if (
97+ ! options . experimentalFunctions &&
98+ ! schema . tags . includes ( "@untyped" )
99+ ) {
100+ return ;
101+ }
96102
97103 const _getLines = cachedFn ( ( ) => this . file . code . split ( "\n" ) ) ;
98104 const getCode : GetCodeFn = ( loc ) => {
Original file line number Diff line number Diff line change @@ -23,7 +23,7 @@ export async function loadSchema(
2323 interopDefault : true ,
2424 transformOptions : {
2525 babel : {
26- plugins : [ untypedPlugin ] ,
26+ plugins : [ [ untypedPlugin , { experimentalFunctions : true } ] ] ,
2727 } ,
2828 } ,
2929 } )
You can’t perform that action at this time.
0 commit comments