source: trip-planner-front/node_modules/@babel/preset-env/lib/polyfills/utils.js

Last change on this file was 6a3a178, checked in by Ema <ema_spirova@…>, 3 years ago

initial commit

  • Property mode set to 100644
File size: 825 bytes
Line 
1"use strict";
2
3Object.defineProperty(exports, "__esModule", {
4 value: true
5});
6exports.getImportSource = getImportSource;
7exports.getRequireSource = getRequireSource;
8exports.isPolyfillSource = isPolyfillSource;
9
10var t = require("@babel/types");
11
12function getImportSource({
13 node
14}) {
15 if (node.specifiers.length === 0) return node.source.value;
16}
17
18function getRequireSource({
19 node
20}) {
21 if (!t.isExpressionStatement(node)) return;
22 const {
23 expression
24 } = node;
25
26 if (t.isCallExpression(expression) && t.isIdentifier(expression.callee) && expression.callee.name === "require" && expression.arguments.length === 1 && t.isStringLiteral(expression.arguments[0])) {
27 return expression.arguments[0].value;
28 }
29}
30
31function isPolyfillSource(source) {
32 return source === "@babel/polyfill" || source === "core-js";
33}
Note: See TracBrowser for help on using the repository browser.