You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
34 lines
896 B
34 lines
896 B
"use strict";
|
|
|
|
Object.defineProperty(exports, "__esModule", {
|
|
value: true
|
|
});
|
|
exports.default = exports.proposals = void 0;
|
|
|
|
var _helperPluginUtils = require("@babel/helper-plugin-utils");
|
|
|
|
const proposals = ["minimal", "smart", "fsharp"];
|
|
exports.proposals = proposals;
|
|
|
|
var _default = (0, _helperPluginUtils.declare)((api, {
|
|
proposal
|
|
}) => {
|
|
api.assertVersion(7);
|
|
|
|
if (typeof proposal !== "string" || !proposals.includes(proposal)) {
|
|
throw new Error("The pipeline operator plugin requires a 'proposal' option." + "'proposal' must be one of: " + proposals.join(", ") + ". More details: https://babeljs.io/docs/en/next/babel-plugin-proposal-pipeline-operator");
|
|
}
|
|
|
|
return {
|
|
name: "syntax-pipeline-operator",
|
|
|
|
manipulateOptions(opts, parserOpts) {
|
|
parserOpts.plugins.push(["pipelineOperator", {
|
|
proposal
|
|
}]);
|
|
}
|
|
|
|
};
|
|
});
|
|
|
|
exports.default = _default; |