get-possible-preset-names.js 464 B

123456789101112131415161718
  1. "use strict";
  2. exports.__esModule = true;
  3. exports.default = getPossiblePresetNames;
  4. function getPossiblePresetNames(presetName) {
  5. var possibleNames = ["babel-preset-" + presetName, presetName];
  6. var matches = presetName.match(/^(@[^/]+)\/(.+)$/);
  7. if (matches) {
  8. var orgName = matches[1],
  9. presetPath = matches[2];
  10. possibleNames.push(orgName + "/babel-preset-" + presetPath);
  11. }
  12. return possibleNames;
  13. }
  14. module.exports = exports["default"];