@babel/plugin-syntax-flow
Advanced tools
+6
-10
| import { declare } from '@babel/helper-plugin-utils'; | ||
| var index = declare((api, options) => { | ||
| api.assertVersion("8.0.0-beta.3"); | ||
| api.assertVersion("^7.0.0-0 || ^8.0.0 || 8.0.0-beta.4"); | ||
| const { | ||
@@ -12,6 +12,4 @@ all, | ||
| } | ||
| { | ||
| if (enums !== undefined) { | ||
| throw new Error("The .enums option has been removed and it's now always enabled. Please remove it from your config."); | ||
| } | ||
| if (enums !== undefined) { | ||
| throw new Error("The .enums option has been removed and it's now always enabled. Please remove it from your config."); | ||
| } | ||
@@ -21,7 +19,5 @@ return { | ||
| manipulateOptions(opts, parserOpts) { | ||
| { | ||
| parserOpts.plugins.push(["flow", { | ||
| all | ||
| }]); | ||
| } | ||
| parserOpts.plugins.push(["flow", { | ||
| all | ||
| }]); | ||
| } | ||
@@ -28,0 +24,0 @@ }; |
+1
-1
@@ -1,1 +0,1 @@ | ||
| {"version":3,"file":"index.js","sources":["../src/index.ts"],"sourcesContent":["import { declare } from \"@babel/helper-plugin-utils\";\n\nexport interface Options {\n all?: boolean;\n}\n\nexport default declare((api, options: Options) => {\n api.assertVersion(REQUIRED_VERSION(7));\n\n // When enabled and plugins includes flow, all files should be parsed as if\n // the @flow pragma was provided.\n // @ts-expect-error Babel 7\n const { all, enums } = options;\n\n if (typeof all !== \"boolean\" && all !== undefined) {\n throw new Error(\".all must be a boolean, or undefined\");\n }\n\n if (process.env.BABEL_8_BREAKING) {\n if (enums !== undefined) {\n throw new Error(\n \"The .enums option has been removed and it's now always enabled. Please remove it from your config.\",\n );\n }\n } else {\n if (enums === false) {\n console.warn(\n \"The .enums option has been removed and it's now always enabled.\",\n );\n }\n }\n\n return {\n name: \"syntax-flow\",\n\n manipulateOptions(opts, parserOpts) {\n if (!process.env.BABEL_8_BREAKING) {\n // If the file has already enabled TS, assume that this is not a\n // valid Flowtype file.\n if (\n parserOpts.plugins.some(\n p => (Array.isArray(p) ? p[0] : p) === \"typescript\",\n )\n ) {\n return;\n }\n }\n\n if (process.env.BABEL_8_BREAKING) {\n parserOpts.plugins.push([\"flow\", { all }]);\n } else {\n // @ts-expect-error Babel 7\n parserOpts.plugins.push([\"flow\", { all, enums }]);\n }\n },\n };\n});\n"],"names":["declare","api","options","assertVersion","all","enums","undefined","Error","name","manipulateOptions","opts","parserOpts","plugins","push"],"mappings":";;AAMA,YAAeA,OAAO,CAAC,CAACC,GAAG,EAAEC,OAAgB,KAAK;EAChDD,GAAG,CAACE,aAAa,CAAA,cAAoB,CAAC,CAAA;EAKtC,MAAM;IAAEC,GAAG;AAAEC,IAAAA,KAAAA;AAAM,GAAC,GAAGH,OAAO,CAAA;EAE9B,IAAI,OAAOE,GAAG,KAAK,SAAS,IAAIA,GAAG,KAAKE,SAAS,EAAE;AACjD,IAAA,MAAM,IAAIC,KAAK,CAAC,sCAAsC,CAAC,CAAA;AACzD,GAAA;AAEkC,EAAA;IAChC,IAAIF,KAAK,KAAKC,SAAS,EAAE;AACvB,MAAA,MAAM,IAAIC,KAAK,CACb,oGACF,CAAC,CAAA;AACH,KAAA;AACF,GAAA;EAQA,OAAO;AACLC,IAAAA,IAAI,EAAE,aAAa;AAEnBC,IAAAA,iBAAiBA,CAACC,IAAI,EAAEC,UAAU,EAAE;AAaA,MAAA;AAChCA,QAAAA,UAAU,CAACC,OAAO,CAACC,IAAI,CAAC,CAAC,MAAM,EAAE;AAAET,UAAAA,GAAAA;AAAI,SAAC,CAAC,CAAC,CAAA;AAC5C,OAAA;AAIF,KAAA;GACD,CAAA;AACH,CAAC,CAAC;;;;"} | ||
| {"version":3,"file":"index.js","sources":["../src/index.ts"],"sourcesContent":["import { declare } from \"@babel/helper-plugin-utils\";\n\nexport interface Options {\n all?: boolean;\n}\n\nexport default declare((api, options: Options) => {\n api.assertVersion(REQUIRED_VERSION(\"^7.0.0-0 || ^8.0.0\"));\n\n // When enabled and plugins includes flow, all files should be parsed as if\n // the @flow pragma was provided.\n // @ts-expect-error Babel 7\n const { all, enums } = options;\n\n if (typeof all !== \"boolean\" && all !== undefined) {\n throw new Error(\".all must be a boolean, or undefined\");\n }\n\n if (enums !== undefined) {\n throw new Error(\n \"The .enums option has been removed and it's now always enabled. Please remove it from your config.\",\n );\n }\n\n return {\n name: \"syntax-flow\",\n\n manipulateOptions(opts, parserOpts) {\n parserOpts.plugins.push([\"flow\", { all }]);\n },\n };\n});\n"],"names":["declare","api","options","assertVersion","all","enums","undefined","Error","name","manipulateOptions","opts","parserOpts","plugins","push"],"mappings":";;AAMA,YAAeA,OAAO,CAAC,CAACC,GAAG,EAAEC,OAAgB,KAAK;EAChDD,GAAG,CAACE,aAAa,CAAA,oCAAuC,CAAC,CAAA;EAKzD,MAAM;IAAEC,GAAG;AAAEC,IAAAA,KAAAA;AAAM,GAAC,GAAGH,OAAO,CAAA;EAE9B,IAAI,OAAOE,GAAG,KAAK,SAAS,IAAIA,GAAG,KAAKE,SAAS,EAAE;AACjD,IAAA,MAAM,IAAIC,KAAK,CAAC,sCAAsC,CAAC,CAAA;AACzD,GAAA;EAEA,IAAIF,KAAK,KAAKC,SAAS,EAAE;AACvB,IAAA,MAAM,IAAIC,KAAK,CACb,oGACF,CAAC,CAAA;AACH,GAAA;EAEA,OAAO;AACLC,IAAAA,IAAI,EAAE,aAAa;AAEnBC,IAAAA,iBAAiBA,CAACC,IAAI,EAAEC,UAAU,EAAE;AAClCA,MAAAA,UAAU,CAACC,OAAO,CAACC,IAAI,CAAC,CAAC,MAAM,EAAE;AAAET,QAAAA,GAAAA;AAAI,OAAC,CAAC,CAAC,CAAA;AAC5C,KAAA;GACD,CAAA;AACH,CAAC,CAAC;;;;"} |
+4
-4
| { | ||
| "name": "@babel/plugin-syntax-flow", | ||
| "version": "8.0.0-beta.3", | ||
| "version": "8.0.0-beta.4", | ||
| "description": "Allow parsing of the flow syntax", | ||
@@ -20,9 +20,9 @@ "repository": { | ||
| "dependencies": { | ||
| "@babel/helper-plugin-utils": "^8.0.0-beta.3" | ||
| "@babel/helper-plugin-utils": "^8.0.0-beta.4" | ||
| }, | ||
| "peerDependencies": { | ||
| "@babel/core": "^8.0.0-beta.3" | ||
| "@babel/core": "^7.0.0-0" | ||
| }, | ||
| "devDependencies": { | ||
| "@babel/core": "^8.0.0-beta.3" | ||
| "@babel/core": "^8.0.0-beta.4" | ||
| }, | ||
@@ -29,0 +29,0 @@ "engines": { |
5098
-12.88%30
-11.76%+ Added
+ Added
+ Added
+ Added
+ Added
+ Added
+ Added
+ Added
+ Added
+ Added
+ Added
+ Added
+ Added
+ Added
+ Added
+ Added
+ Added
+ Added
+ Added
+ Added
+ Added
+ Added
+ Added