source: trip-planner-front/node_modules/@babel/helper-skip-transparent-expression-wrappers/lib/index.js@ 6a3a178

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

initial commit

  • Property mode set to 100644
File size: 729 bytes
Line 
1"use strict";
2
3Object.defineProperty(exports, "__esModule", {
4 value: true
5});
6exports.isTransparentExprWrapper = isTransparentExprWrapper;
7exports.skipTransparentExprWrappers = skipTransparentExprWrappers;
8
9var _t = require("@babel/types");
10
11const {
12 isParenthesizedExpression,
13 isTSAsExpression,
14 isTSNonNullExpression,
15 isTSTypeAssertion,
16 isTypeCastExpression
17} = _t;
18
19function isTransparentExprWrapper(node) {
20 return isTSAsExpression(node) || isTSTypeAssertion(node) || isTSNonNullExpression(node) || isTypeCastExpression(node) || isParenthesizedExpression(node);
21}
22
23function skipTransparentExprWrappers(path) {
24 while (isTransparentExprWrapper(path.node)) {
25 path = path.get("expression");
26 }
27
28 return path;
29}
Note: See TracBrowser for help on using the repository browser.