Socket
Socket
Sign inDemoInstall

@babel/preset-flow

Package Overview
Dependencies
59
Maintainers
4
Versions
69
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

Comparing version 8.0.0-alpha.6 to 8.0.0-alpha.7

41

lib/index.js

@@ -9,3 +9,4 @@ import { declarePreset } from '@babel/helper-plugin-utils';

all,
ignoreExtensions
ignoreExtensions,
experimental_useHermesParser
} = options;

@@ -16,3 +17,4 @@ {

all: "all",
ignoreExtensions: "ignoreExtensions"
ignoreExtensions: "ignoreExtensions",
experimental_useHermesParser: "experimental_useHermesParser"
};

@@ -22,5 +24,7 @@ v.validateTopLevelOptions(options, TopLevelOptions);

ignoreExtensions = v.validateBooleanOption(TopLevelOptions.ignoreExtensions, ignoreExtensions);
experimental_useHermesParser = v.validateBooleanOption(TopLevelOptions.experimental_useHermesParser, experimental_useHermesParser);
return {
all,
ignoreExtensions
ignoreExtensions,
experimental_useHermesParser
};

@@ -31,25 +35,30 @@ }

var index = declarePreset((api, opts) => {
api.assertVersion("8.0.0-alpha.6");
api.assertVersion("8.0.0-alpha.7");
const {
all,
allowDeclareFields,
ignoreExtensions = false
ignoreExtensions = false,
experimental_useHermesParser: useHermesParser = false
} = normalizeOptions(opts);
const flowPlugin = [transformFlowStripTypes, {
const plugins = [[transformFlowStripTypes, {
all,
allowDeclareFields
}];
}]];
if (useHermesParser) {
if (Number.parseInt(process.versions.node, 10) < 12) {
throw new Error("The Hermes parser is only supported in Node 12 and later.");
}
plugins.unshift("babel-plugin-syntax-hermes-parser");
}
if (ignoreExtensions) {
return {
plugins: [flowPlugin]
plugins
};
}
{
return {
overrides: [{
test: filename => filename == null || !/\.tsx?$/.test(filename),
plugins: [flowPlugin]
}]
};
}
return {
overrides: [{
test: filename => filename == null || !/\.tsx?$/.test(filename),
plugins
}]
};
});

@@ -56,0 +65,0 @@

{
"name": "@babel/preset-flow",
"version": "8.0.0-alpha.6",
"version": "8.0.0-alpha.7",
"description": "Babel preset for all Flow plugins.",

@@ -23,12 +23,13 @@ "author": "The Babel Team (https://babel.dev/team)",

"dependencies": {
"@babel/helper-plugin-utils": "^8.0.0-alpha.6",
"@babel/helper-validator-option": "^8.0.0-alpha.6",
"@babel/plugin-transform-flow-strip-types": "^8.0.0-alpha.6"
"@babel/helper-plugin-utils": "^8.0.0-alpha.7",
"@babel/helper-validator-option": "^8.0.0-alpha.7",
"@babel/plugin-transform-flow-strip-types": "^8.0.0-alpha.7"
},
"peerDependencies": {
"@babel/core": "^8.0.0-alpha.6"
"@babel/core": "^8.0.0-alpha.7"
},
"devDependencies": {
"@babel/core": "^8.0.0-alpha.6",
"@babel/helper-plugin-test-runner": "^8.0.0-alpha.6"
"@babel/core": "^8.0.0-alpha.7",
"@babel/helper-plugin-test-runner": "^8.0.0-alpha.7",
"babel-plugin-syntax-hermes-parser": "^0.19.1"
},

@@ -35,0 +36,0 @@ "homepage": "https://babel.dev/docs/en/next/babel-preset-flow",

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc