mirror of
https://github.com/idanoo/GoScrobble.git
synced 2024-11-25 09:55:15 +00:00
21 lines
603 B
JavaScript
21 lines
603 B
JavaScript
"use strict";
|
|
|
|
Object.defineProperty(exports, "__esModule", {
|
|
value: true
|
|
});
|
|
exports.isTransparentExprWrapper = isTransparentExprWrapper;
|
|
exports.skipTransparentExprWrappers = skipTransparentExprWrappers;
|
|
|
|
var t = require("@babel/types");
|
|
|
|
function isTransparentExprWrapper(node) {
|
|
return t.isTSAsExpression(node) || t.isTSTypeAssertion(node) || t.isTSNonNullExpression(node) || t.isTypeCastExpression(node) || t.isParenthesizedExpression(node);
|
|
}
|
|
|
|
function skipTransparentExprWrappers(path) {
|
|
while (isTransparentExprWrapper(path.node)) {
|
|
path = path.get("expression");
|
|
}
|
|
|
|
return path;
|
|
} |