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

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

primeNG components

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