Big News: Socket raises $60M Series C at a $1B valuation to secure software supply chains for AI-driven development.Announcement
Sign In

@babel/plugin-syntax-flow

Package Overview
Dependencies
Maintainers
4
Versions
95
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@babel/plugin-syntax-flow - npm Package Compare versions

Comparing version
8.0.0-beta.3
to
8.0.0-beta.4
+6
-10
lib/index.js
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 +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;;;;"}
{
"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": {