🚀 Socket Launch Week Day 5:Introducing Repository Access Permissions and Custom Roles.Learn more
Sign In

@babel/plugin-syntax-flow

Package Overview
Dependencies
Maintainers
4
Versions
97
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-alpha.17
to
8.0.0-beta.0
+1
-1
lib/index.js
import { declare } from '@babel/helper-plugin-utils';
var index = declare((api, options) => {
api.assertVersion("8.0.0-alpha.17");
api.assertVersion("8.0.0-beta.0");
const {

@@ -6,0 +6,0 @@ all,

@@ -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,gBAAoB,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));\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;;;;"}
{
"name": "@babel/plugin-syntax-flow",
"version": "8.0.0-alpha.17",
"version": "8.0.0-beta.0",
"description": "Allow parsing of the flow syntax",

@@ -20,12 +20,12 @@ "repository": {

"dependencies": {
"@babel/helper-plugin-utils": "^8.0.0-alpha.17"
"@babel/helper-plugin-utils": "^8.0.0-beta.0"
},
"peerDependencies": {
"@babel/core": "^8.0.0-alpha.17"
"@babel/core": "^8.0.0-beta.0"
},
"devDependencies": {
"@babel/core": "^8.0.0-alpha.17"
"@babel/core": "^8.0.0-beta.0"
},
"engines": {
"node": "^18.20.0 || ^20.17.0 || >=22.8.0"
"node": "^20.19.0 || >=22.12.0"
},

@@ -32,0 +32,0 @@ "author": "The Babel Team (https://babel.dev/team)",