@voltiso/transform
Advanced tools
Comparing version 3.0.3 to 3.0.4
"use strict"; | ||
// ⠀ⓥ 2022 🌩 🌩 ⠀ ⠀ | ||
// ⠀ⓥ 2023 🌩 🌩 ⠀ ⠀ | ||
// ⠀ 🌩 V͛o͛͛͛lt͛͛͛i͛͛͛͛so͛͛͛.com⠀ ⠀⠀⠀ | ||
@@ -4,0 +4,0 @@ Object.defineProperty(exports, "__esModule", { value: true }); |
"use strict"; | ||
// ⠀ⓥ 2022 🌩 🌩 ⠀ ⠀ | ||
// ⠀ⓥ 2023 🌩 🌩 ⠀ ⠀ | ||
// ⠀ 🌩 V͛o͛͛͛lt͛͛͛i͛͛͛͛so͛͛͛.com⠀ ⠀⠀⠀ | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
//# sourceMappingURL=DeepPartial.js.map |
"use strict"; | ||
// ⠀ⓥ 2022 🌩 🌩 ⠀ ⠀ | ||
// ⠀ⓥ 2023 🌩 🌩 ⠀ ⠀ | ||
// ⠀ 🌩 V͛o͛͛͛lt͛͛͛i͛͛͛͛so͛͛͛.com⠀ ⠀⠀⠀ | ||
@@ -4,0 +4,0 @@ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { |
"use strict"; | ||
// ⠀ⓥ 2022 🌩 🌩 ⠀ ⠀ | ||
// ⠀ⓥ 2023 🌩 🌩 ⠀ ⠀ | ||
// ⠀ 🌩 V͛o͛͛͛lt͛͛͛i͛͛͛͛so͛͛͛.com⠀ ⠀⠀⠀ | ||
@@ -4,0 +4,0 @@ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { |
"use strict"; | ||
// ⠀ⓥ 2022 🌩 🌩 ⠀ ⠀ | ||
// ⠀ⓥ 2023 🌩 🌩 ⠀ ⠀ | ||
// ⠀ 🌩 V͛o͛͛͛lt͛͛͛i͛͛͛͛so͛͛͛.com⠀ ⠀⠀⠀ | ||
@@ -4,0 +4,0 @@ Object.defineProperty(exports, "__esModule", { value: true }); |
"use strict"; | ||
// ⠀ⓥ 2022 🌩 🌩 ⠀ ⠀ | ||
// ⠀ⓥ 2023 🌩 🌩 ⠀ ⠀ | ||
// ⠀ 🌩 V͛o͛͛͛lt͛͛͛i͛͛͛͛so͛͛͛.com⠀ ⠀⠀⠀ | ||
@@ -4,0 +4,0 @@ Object.defineProperty(exports, "__esModule", { value: true }); |
"use strict"; | ||
// ⠀ⓥ 2022 🌩 🌩 ⠀ ⠀ | ||
// ⠀ⓥ 2023 🌩 🌩 ⠀ ⠀ | ||
// ⠀ 🌩 V͛o͛͛͛lt͛͛͛i͛͛͛͛so͛͛͛.com⠀ ⠀⠀⠀ | ||
@@ -4,0 +4,0 @@ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { |
"use strict"; | ||
// ⠀ⓥ 2022 🌩 🌩 ⠀ ⠀ | ||
// ⠀ⓥ 2023 🌩 🌩 ⠀ ⠀ | ||
// ⠀ 🌩 V͛o͛͛͛lt͛͛͛i͛͛͛͛so͛͛͛.com⠀ ⠀⠀⠀ | ||
@@ -4,0 +4,0 @@ var __importDefault = (this && this.__importDefault) || function (mod) { |
"use strict"; | ||
// ⠀ⓥ 2022 🌩 🌩 ⠀ ⠀ | ||
// ⠀ⓥ 2023 🌩 🌩 ⠀ ⠀ | ||
// ⠀ 🌩 V͛o͛͛͛lt͛͛͛i͛͛͛͛so͛͛͛.com⠀ ⠀⠀⠀ | ||
@@ -4,0 +4,0 @@ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { |
"use strict"; | ||
// ⠀ⓥ 2022 🌩 🌩 ⠀ ⠀ | ||
// ⠀ⓥ 2023 🌩 🌩 ⠀ ⠀ | ||
// ⠀ 🌩 V͛o͛͛͛lt͛͛͛i͛͛͛͛so͛͛͛.com⠀ ⠀⠀⠀ | ||
@@ -4,0 +4,0 @@ Object.defineProperty(exports, "__esModule", { value: true }); |
"use strict"; | ||
// ⠀ⓥ 2022 🌩 🌩 ⠀ ⠀ | ||
// ⠀ⓥ 2023 🌩 🌩 ⠀ ⠀ | ||
// ⠀ 🌩 V͛o͛͛͛lt͛͛͛i͛͛͛͛so͛͛͛.com⠀ ⠀⠀⠀ | ||
@@ -4,0 +4,0 @@ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { |
"use strict"; | ||
// ⠀ⓥ 2022 🌩 🌩 ⠀ ⠀ | ||
// ⠀ⓥ 2023 🌩 🌩 ⠀ ⠀ | ||
// ⠀ 🌩 V͛o͛͛͛lt͛͛͛i͛͛͛͛so͛͛͛.com⠀ ⠀⠀⠀ | ||
@@ -4,0 +4,0 @@ Object.defineProperty(exports, "__esModule", { value: true }); |
"use strict"; | ||
// ⠀ⓥ 2022 🌩 🌩 ⠀ ⠀ | ||
// ⠀ⓥ 2023 🌩 🌩 ⠀ ⠀ | ||
// ⠀ 🌩 V͛o͛͛͛lt͛͛͛i͛͛͛͛so͛͛͛.com⠀ ⠀⠀⠀ | ||
@@ -4,0 +4,0 @@ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { |
"use strict"; | ||
// ⠀ⓥ 2022 🌩 🌩 ⠀ ⠀ | ||
// ⠀ⓥ 2023 🌩 🌩 ⠀ ⠀ | ||
// ⠀ 🌩 V͛o͛͛͛lt͛͛͛i͛͛͛͛so͛͛͛.com⠀ ⠀⠀⠀ | ||
@@ -4,0 +4,0 @@ var __importDefault = (this && this.__importDefault) || function (mod) { |
"use strict"; | ||
// ⠀ⓥ 2022 🌩 🌩 ⠀ ⠀ | ||
// ⠀ⓥ 2023 🌩 🌩 ⠀ ⠀ | ||
// ⠀ 🌩 V͛o͛͛͛lt͛͛͛i͛͛͛͛so͛͛͛.com⠀ ⠀⠀⠀ | ||
@@ -4,0 +4,0 @@ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { |
"use strict"; | ||
// ⠀ⓥ 2022 🌩 🌩 ⠀ ⠀ | ||
// ⠀ⓥ 2023 🌩 🌩 ⠀ ⠀ | ||
// ⠀ 🌩 V͛o͛͛͛lt͛͛͛i͛͛͛͛so͛͛͛.com⠀ ⠀⠀⠀ | ||
@@ -4,0 +4,0 @@ Object.defineProperty(exports, "__esModule", { value: true }); |
"use strict"; | ||
// ⠀ⓥ 2022 🌩 🌩 ⠀ ⠀ | ||
// ⠀ⓥ 2023 🌩 🌩 ⠀ ⠀ | ||
// ⠀ 🌩 V͛o͛͛͛lt͛͛͛i͛͛͛͛so͛͛͛.com⠀ ⠀⠀⠀ | ||
@@ -4,0 +4,0 @@ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { |
"use strict"; | ||
// ⠀ⓥ 2022 🌩 🌩 ⠀ ⠀ | ||
// ⠀ⓥ 2023 🌩 🌩 ⠀ ⠀ | ||
// ⠀ 🌩 V͛o͛͛͛lt͛͛͛i͛͛͛͛so͛͛͛.com⠀ ⠀⠀⠀ | ||
@@ -72,2 +72,3 @@ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { | ||
const symbolsOutOfScope = (0, collectSymbolNames_1.collectSymbolNames)(newNode); | ||
// console.log('collected symbol names', symbolsOutOfScope) | ||
// console.log(newSymbolNames) | ||
@@ -74,0 +75,0 @@ const symbolNames = (0, collectSymbolNames_1.collectSymbolNames)(node); |
"use strict"; | ||
// ⠀ⓥ 2022 🌩 🌩 ⠀ ⠀ | ||
// ⠀ⓥ 2023 🌩 🌩 ⠀ ⠀ | ||
// ⠀ 🌩 V͛o͛͛͛lt͛͛͛i͛͛͛͛so͛͛͛.com⠀ ⠀⠀⠀ | ||
@@ -4,0 +4,0 @@ Object.defineProperty(exports, "__esModule", { value: true }); |
import * as ts from 'typescript'; | ||
interface SymbolObject { | ||
escapedName: string; | ||
parent?: SymbolObject; | ||
flags: number; | ||
} | ||
export declare function getSymbolPath(symbol: SymbolObject | undefined): string[]; | ||
export declare function collectSymbolNames(node: ts.Node): Set<string>; | ||
export {}; | ||
//# sourceMappingURL=collectSymbolNames.d.ts.map |
"use strict"; | ||
// ⠀ⓥ 2022 🌩 🌩 ⠀ ⠀ | ||
// ⠀ⓥ 2023 🌩 🌩 ⠀ ⠀ | ||
// ⠀ 🌩 V͛o͛͛͛lt͛͛͛i͛͛͛͛so͛͛͛.com⠀ ⠀⠀⠀ | ||
@@ -28,8 +28,21 @@ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
exports.collectSymbolNames = void 0; | ||
exports.collectSymbolNames = exports.getSymbolPath = void 0; | ||
/* eslint-disable no-bitwise */ | ||
const ts = __importStar(require("typescript")); | ||
function getSymbolPath(symbol) { | ||
if (!symbol) | ||
return []; | ||
if ((symbol.parent?.flags ?? ts.SymbolFlags.ValueModule) & | ||
ts.SymbolFlags.ValueModule) { | ||
return [symbol.escapedName]; | ||
} | ||
return [...getSymbolPath(symbol.parent), symbol.escapedName]; | ||
} | ||
exports.getSymbolPath = getSymbolPath; | ||
function collectSymbolNames(node) { | ||
const result = new Set(); | ||
if (ts.isTypeReferenceNode(node) && ts.isIdentifier(node.typeName)) { | ||
result.add(node.typeName.text); | ||
// eslint-disable-next-line @typescript-eslint/no-unsafe-member-access | ||
const symbol = node.typeName?.symbol; | ||
result.add(getSymbolPath(symbol)[0] || node.typeName.text); | ||
} | ||
@@ -36,0 +49,0 @@ node.forEachChild(child => { |
"use strict"; | ||
// ⠀ⓥ 2022 🌩 🌩 ⠀ ⠀ | ||
// ⠀ⓥ 2023 🌩 🌩 ⠀ ⠀ | ||
// ⠀ 🌩 V͛o͛͛͛lt͛͛͛i͛͛͛͛so͛͛͛.com⠀ ⠀⠀⠀ | ||
@@ -4,0 +4,0 @@ Object.defineProperty(exports, "__esModule", { value: true }); |
"use strict"; | ||
// ⠀ⓥ 2022 🌩 🌩 ⠀ ⠀ | ||
// ⠀ⓥ 2023 🌩 🌩 ⠀ ⠀ | ||
// ⠀ 🌩 V͛o͛͛͛lt͛͛͛i͛͛͛͛so͛͛͛.com⠀ ⠀⠀⠀ | ||
@@ -4,0 +4,0 @@ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { |
"use strict"; | ||
// ⠀ⓥ 2022 🌩 🌩 ⠀ ⠀ | ||
// ⠀ⓥ 2023 🌩 🌩 ⠀ ⠀ | ||
// ⠀ 🌩 V͛o͛͛͛lt͛͛͛i͛͛͛͛so͛͛͛.com⠀ ⠀⠀⠀ | ||
@@ -4,0 +4,0 @@ Object.defineProperty(exports, "__esModule", { value: true }); |
"use strict"; | ||
// ⠀ⓥ 2022 🌩 🌩 ⠀ ⠀ | ||
// ⠀ⓥ 2023 🌩 🌩 ⠀ ⠀ | ||
// ⠀ 🌩 V͛o͛͛͛lt͛͛͛i͛͛͛͛so͛͛͛.com⠀ ⠀⠀⠀ | ||
@@ -4,0 +4,0 @@ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { |
"use strict"; | ||
// ⠀ⓥ 2022 🌩 🌩 ⠀ ⠀ | ||
// ⠀ⓥ 2023 🌩 🌩 ⠀ ⠀ | ||
// ⠀ 🌩 V͛o͛͛͛lt͛͛͛i͛͛͛͛so͛͛͛.com⠀ ⠀⠀⠀ | ||
@@ -4,0 +4,0 @@ var __importDefault = (this && this.__importDefault) || function (mod) { |
"use strict"; | ||
// ⠀ⓥ 2022 🌩 🌩 ⠀ ⠀ | ||
// ⠀ⓥ 2023 🌩 🌩 ⠀ ⠀ | ||
// ⠀ 🌩 V͛o͛͛͛lt͛͛͛i͛͛͛͛so͛͛͛.com⠀ ⠀⠀⠀ | ||
@@ -31,3 +31,22 @@ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { | ||
const ts = __importStar(require("typescript")); | ||
const _1 = require("."); | ||
const simplifyNode_1 = require("./simplifyNode"); | ||
function buildNestedQualifiedName(symbolPath) { | ||
if (symbolPath.length === 1) | ||
return ts.factory.createIdentifier(symbolPath[0]); | ||
return ts.factory.createQualifiedName(buildNestedQualifiedName(symbolPath.slice(0, -1)), symbolPath.at(-1)); | ||
} | ||
function fixNamespaces(ctx, node) { | ||
function visitor(node) { | ||
if (ts.isTypeReferenceNode(node)) { | ||
// eslint-disable-next-line @typescript-eslint/no-unsafe-argument, @typescript-eslint/no-unsafe-member-access | ||
const symbolPath = (0, _1.getSymbolPath)(node.typeName.symbol); | ||
if (symbolPath.length === 0) | ||
return node; | ||
return buildNestedQualifiedName(symbolPath); | ||
} | ||
return ts.visitEachChild(node, visitor, ctx.transformationContext); | ||
} | ||
return ts.visitEachChild(node, visitor, ctx.transformationContext); | ||
} | ||
function simplifyAndAddComment(ctx, originalNode) { | ||
@@ -38,4 +57,6 @@ let node = (0, simplifyNode_1.simplifyNode)(ctx, originalNode); | ||
const comment = (0, transform_lib_1.getNodeText)(ctx, ts.getOriginalNode(originalNode)); | ||
if (comment) | ||
if (comment) { | ||
node = ts.addSyntheticLeadingComment(node, ts.SyntaxKind.MultiLineCommentTrivia, ` ${comment} `); | ||
} | ||
node = fixNamespaces(ctx, node); | ||
return node; | ||
@@ -42,0 +63,0 @@ } |
"use strict"; | ||
// ⠀ⓥ 2022 🌩 🌩 ⠀ ⠀ | ||
// ⠀ⓥ 2023 🌩 🌩 ⠀ ⠀ | ||
// ⠀ 🌩 V͛o͛͛͛lt͛͛͛i͛͛͛͛so͛͛͛.com⠀ ⠀⠀⠀ | ||
@@ -4,0 +4,0 @@ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { |
"use strict"; | ||
// ⠀ⓥ 2022 🌩 🌩 ⠀ ⠀ | ||
// ⠀ⓥ 2023 🌩 🌩 ⠀ ⠀ | ||
// ⠀ 🌩 V͛o͛͛͛lt͛͛͛i͛͛͛͛so͛͛͛.com⠀ ⠀⠀⠀ | ||
@@ -4,0 +4,0 @@ Object.defineProperty(exports, "__esModule", { value: true }); |
"use strict"; | ||
// ⠀ⓥ 2022 🌩 🌩 ⠀ ⠀ | ||
// ⠀ⓥ 2023 🌩 🌩 ⠀ ⠀ | ||
// ⠀ 🌩 V͛o͛͛͛lt͛͛͛i͛͛͛͛so͛͛͛.com⠀ ⠀⠀⠀ | ||
@@ -4,0 +4,0 @@ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { |
"use strict"; | ||
// ⠀ⓥ 2022 🌩 🌩 ⠀ ⠀ | ||
// ⠀ⓥ 2023 🌩 🌩 ⠀ ⠀ | ||
// ⠀ 🌩 V͛o͛͛͛lt͛͛͛i͛͛͛͛so͛͛͛.com⠀ ⠀⠀⠀ | ||
@@ -4,0 +4,0 @@ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { |
"use strict"; | ||
// ⠀ⓥ 2022 🌩 🌩 ⠀ ⠀ | ||
// ⠀ⓥ 2023 🌩 🌩 ⠀ ⠀ | ||
// ⠀ 🌩 V͛o͛͛͛lt͛͛͛i͛͛͛͛so͛͛͛.com⠀ ⠀⠀⠀ | ||
@@ -4,0 +4,0 @@ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { |
"use strict"; | ||
// ⠀ⓥ 2022 🌩 🌩 ⠀ ⠀ | ||
// ⠀ⓥ 2023 🌩 🌩 ⠀ ⠀ | ||
// ⠀ 🌩 V͛o͛͛͛lt͛͛͛i͛͛͛͛so͛͛͛.com⠀ ⠀⠀⠀ | ||
@@ -4,0 +4,0 @@ var __importDefault = (this && this.__importDefault) || function (mod) { |
"use strict"; | ||
// ⠀ⓥ 2022 🌩 🌩 ⠀ ⠀ | ||
// ⠀ⓥ 2023 🌩 🌩 ⠀ ⠀ | ||
// ⠀ 🌩 V͛o͛͛͛lt͛͛͛i͛͛͛͛so͛͛͛.com⠀ ⠀⠀⠀ | ||
@@ -4,0 +4,0 @@ Object.defineProperty(exports, "__esModule", { value: true }); |
"use strict"; | ||
// ⠀ⓥ 2022 🌩 🌩 ⠀ ⠀ | ||
// ⠀ⓥ 2023 🌩 🌩 ⠀ ⠀ | ||
// ⠀ 🌩 V͛o͛͛͛lt͛͛͛i͛͛͛͛so͛͛͛.com⠀ ⠀⠀⠀ | ||
@@ -4,0 +4,0 @@ Object.defineProperty(exports, "__esModule", { value: true }); |
"use strict"; | ||
// ⠀ⓥ 2022 🌩 🌩 ⠀ ⠀ | ||
// ⠀ⓥ 2023 🌩 🌩 ⠀ ⠀ | ||
// ⠀ 🌩 V͛o͛͛͛lt͛͛͛i͛͛͛͛so͛͛͛.com⠀ ⠀⠀⠀ | ||
@@ -4,0 +4,0 @@ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { |
"use strict"; | ||
// ⠀ⓥ 2022 🌩 🌩 ⠀ ⠀ | ||
// ⠀ⓥ 2023 🌩 🌩 ⠀ ⠀ | ||
// ⠀ 🌩 V͛o͛͛͛lt͛͛͛i͛͛͛͛so͛͛͛.com⠀ ⠀⠀⠀ | ||
@@ -4,0 +4,0 @@ Object.defineProperty(exports, "__esModule", { value: true }); |
"use strict"; | ||
// ⠀ⓥ 2022 🌩 🌩 ⠀ ⠀ | ||
// ⠀ⓥ 2023 🌩 🌩 ⠀ ⠀ | ||
// ⠀ 🌩 V͛o͛͛͛lt͛͛͛i͛͛͛͛so͛͛͛.com⠀ ⠀⠀⠀ | ||
@@ -4,0 +4,0 @@ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { |
"use strict"; | ||
// ⠀ⓥ 2022 🌩 🌩 ⠀ ⠀ | ||
// ⠀ⓥ 2023 🌩 🌩 ⠀ ⠀ | ||
// ⠀ 🌩 V͛o͛͛͛lt͛͛͛i͛͛͛͛so͛͛͛.com⠀ ⠀⠀⠀ | ||
@@ -4,0 +4,0 @@ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { |
@@ -1,2 +0,2 @@ | ||
// ⠀ⓥ 2022 🌩 🌩 ⠀ ⠀ | ||
// ⠀ⓥ 2023 🌩 🌩 ⠀ ⠀ | ||
// ⠀ 🌩 V͛o͛͛͛lt͛͛͛i͛͛͛͛so͛͛͛.com⠀ ⠀⠀⠀ | ||
@@ -3,0 +3,0 @@ // ! COPIED from `@voltiso/util` - to avoid cyclic package deps |
@@ -1,4 +0,4 @@ | ||
// ⠀ⓥ 2022 🌩 🌩 ⠀ ⠀ | ||
// ⠀ⓥ 2023 🌩 🌩 ⠀ ⠀ | ||
// ⠀ 🌩 V͛o͛͛͛lt͛͛͛i͛͛͛͛so͛͛͛.com⠀ ⠀⠀⠀ | ||
export {}; | ||
//# sourceMappingURL=DeepPartial.js.map |
@@ -1,2 +0,2 @@ | ||
// ⠀ⓥ 2022 🌩 🌩 ⠀ ⠀ | ||
// ⠀ⓥ 2023 🌩 🌩 ⠀ ⠀ | ||
// ⠀ 🌩 V͛o͛͛͛lt͛͛͛i͛͛͛͛so͛͛͛.com⠀ ⠀⠀⠀ | ||
@@ -3,0 +3,0 @@ export * from './_deepMerge'; |
@@ -1,4 +0,4 @@ | ||
// ⠀ⓥ 2022 🌩 🌩 ⠀ ⠀ | ||
// ⠀ⓥ 2023 🌩 🌩 ⠀ ⠀ | ||
// ⠀ 🌩 V͛o͛͛͛lt͛͛͛i͛͛͛͛so͛͛͛.com⠀ ⠀⠀⠀ | ||
export * from './copied-from-util'; | ||
//# sourceMappingURL=index.js.map |
@@ -1,2 +0,2 @@ | ||
// ⠀ⓥ 2022 🌩 🌩 ⠀ ⠀ | ||
// ⠀ⓥ 2023 🌩 🌩 ⠀ ⠀ | ||
// ⠀ 🌩 V͛o͛͛͛lt͛͛͛i͛͛͛͛so͛͛͛.com⠀ ⠀⠀⠀ | ||
@@ -3,0 +3,0 @@ export function isCallInfo(x) { |
@@ -1,2 +0,2 @@ | ||
// ⠀ⓥ 2022 🌩 🌩 ⠀ ⠀ | ||
// ⠀ⓥ 2023 🌩 🌩 ⠀ ⠀ | ||
// ⠀ 🌩 V͛o͛͛͛lt͛͛͛i͛͛͛͛so͛͛͛.com⠀ ⠀⠀⠀ | ||
@@ -3,0 +3,0 @@ function isWithName(node) { |
@@ -1,2 +0,2 @@ | ||
// ⠀ⓥ 2022 🌩 🌩 ⠀ ⠀ | ||
// ⠀ⓥ 2023 🌩 🌩 ⠀ ⠀ | ||
// ⠀ 🌩 V͛o͛͛͛lt͛͛͛i͛͛͛͛so͛͛͛.com⠀ ⠀⠀⠀ | ||
@@ -3,0 +3,0 @@ export * from './CallInfo'; |
@@ -1,2 +0,2 @@ | ||
// ⠀ⓥ 2022 🌩 🌩 ⠀ ⠀ | ||
// ⠀ⓥ 2023 🌩 🌩 ⠀ ⠀ | ||
// ⠀ 🌩 V͛o͛͛͛lt͛͛͛i͛͛͛͛so͛͛͛.com⠀ ⠀⠀⠀ | ||
@@ -3,0 +3,0 @@ import { getNodePositionStr, getNodeText } from '@voltiso/transform.lib'; |
@@ -1,2 +0,2 @@ | ||
// ⠀ⓥ 2022 🌩 🌩 ⠀ ⠀ | ||
// ⠀ⓥ 2023 🌩 🌩 ⠀ ⠀ | ||
// ⠀ 🌩 V͛o͛͛͛lt͛͛͛i͛͛͛͛so͛͛͛.com⠀ ⠀⠀⠀ | ||
@@ -3,0 +3,0 @@ import { _getPackageForFile, createLiteralExpression, getGitRelativePath, } from '@voltiso/transform.lib'; |
@@ -1,2 +0,2 @@ | ||
// ⠀ⓥ 2022 🌩 🌩 ⠀ ⠀ | ||
// ⠀ⓥ 2023 🌩 🌩 ⠀ ⠀ | ||
// ⠀ 🌩 V͛o͛͛͛lt͛͛͛i͛͛͛͛so͛͛͛.com⠀ ⠀⠀⠀ | ||
@@ -3,0 +3,0 @@ // eslint-disable-next-line import/no-default-export |
@@ -1,2 +0,2 @@ | ||
// ⠀ⓥ 2022 🌩 🌩 ⠀ ⠀ | ||
// ⠀ⓥ 2023 🌩 🌩 ⠀ ⠀ | ||
// ⠀ 🌩 V͛o͛͛͛lt͛͛͛i͛͛͛͛so͛͛͛.com⠀ ⠀⠀⠀ | ||
@@ -3,0 +3,0 @@ export * from './_'; |
@@ -1,2 +0,2 @@ | ||
// ⠀ⓥ 2022 🌩 🌩 ⠀ ⠀ | ||
// ⠀ⓥ 2023 🌩 🌩 ⠀ ⠀ | ||
// ⠀ 🌩 V͛o͛͛͛lt͛͛͛i͛͛͛͛so͛͛͛.com⠀ ⠀⠀⠀ | ||
@@ -3,0 +3,0 @@ export const defaultCompatTransformOptions = { |
@@ -1,2 +0,2 @@ | ||
// ⠀ⓥ 2022 🌩 🌩 ⠀ ⠀ | ||
// ⠀ⓥ 2023 🌩 🌩 ⠀ ⠀ | ||
// ⠀ 🌩 V͛o͛͛͛lt͛͛͛i͛͛͛͛so͛͛͛.com⠀ ⠀⠀⠀ | ||
@@ -3,0 +3,0 @@ export * from './CompatTransformOptions'; |
@@ -1,2 +0,2 @@ | ||
// ⠀ⓥ 2022 🌩 🌩 ⠀ ⠀ | ||
// ⠀ⓥ 2023 🌩 🌩 ⠀ ⠀ | ||
// ⠀ 🌩 V͛o͛͛͛lt͛͛͛i͛͛͛͛so͛͛͛.com⠀ ⠀⠀⠀ | ||
@@ -3,0 +3,0 @@ import { getNodePositionStr, getNodeText } from '@voltiso/transform.lib'; |
@@ -1,2 +0,2 @@ | ||
// ⠀ⓥ 2022 🌩 🌩 ⠀ ⠀ | ||
// ⠀ⓥ 2023 🌩 🌩 ⠀ ⠀ | ||
// ⠀ 🌩 V͛o͛͛͛lt͛͛͛i͛͛͛͛so͛͛͛.com⠀ ⠀⠀⠀ | ||
@@ -3,0 +3,0 @@ import * as ts from 'typescript'; |
@@ -1,2 +0,2 @@ | ||
// ⠀ⓥ 2022 🌩 🌩 ⠀ ⠀ | ||
// ⠀ⓥ 2023 🌩 🌩 ⠀ ⠀ | ||
// ⠀ 🌩 V͛o͛͛͛lt͛͛͛i͛͛͛͛so͛͛͛.com⠀ ⠀⠀⠀ | ||
@@ -3,0 +3,0 @@ // eslint-disable-next-line import/no-default-export |
@@ -1,2 +0,2 @@ | ||
// ⠀ⓥ 2022 🌩 🌩 ⠀ ⠀ | ||
// ⠀ⓥ 2023 🌩 🌩 ⠀ ⠀ | ||
// ⠀ 🌩 V͛o͛͛͛lt͛͛͛i͛͛͛͛so͛͛͛.com⠀ ⠀⠀⠀ | ||
@@ -3,0 +3,0 @@ export * from './_'; |
@@ -1,2 +0,2 @@ | ||
// ⠀ⓥ 2022 🌩 🌩 ⠀ ⠀ | ||
// ⠀ⓥ 2023 🌩 🌩 ⠀ ⠀ | ||
// ⠀ 🌩 V͛o͛͛͛lt͛͛͛i͛͛͛͛so͛͛͛.com⠀ ⠀⠀⠀ | ||
@@ -43,2 +43,3 @@ import { getNodePositionStr, getNodeText, stringFromSyntaxKind, } from '@voltiso/transform.lib'; | ||
const symbolsOutOfScope = collectSymbolNames(newNode); | ||
// console.log('collected symbol names', symbolsOutOfScope) | ||
// console.log(newSymbolNames) | ||
@@ -45,0 +46,0 @@ const symbolNames = collectSymbolNames(node); |
@@ -1,2 +0,2 @@ | ||
// ⠀ⓥ 2022 🌩 🌩 ⠀ ⠀ | ||
// ⠀ⓥ 2023 🌩 🌩 ⠀ ⠀ | ||
// ⠀ 🌩 V͛o͛͛͛lt͛͛͛i͛͛͛͛so͛͛͛.com⠀ ⠀⠀⠀ | ||
@@ -3,0 +3,0 @@ export function collectNodesOfKind(node, kind) { |
import * as ts from 'typescript'; | ||
interface SymbolObject { | ||
escapedName: string; | ||
parent?: SymbolObject; | ||
flags: number; | ||
} | ||
export declare function getSymbolPath(symbol: SymbolObject | undefined): string[]; | ||
export declare function collectSymbolNames(node: ts.Node): Set<string>; | ||
export {}; | ||
//# sourceMappingURL=collectSymbolNames.d.ts.map |
@@ -1,8 +0,20 @@ | ||
// ⠀ⓥ 2022 🌩 🌩 ⠀ ⠀ | ||
// ⠀ⓥ 2023 🌩 🌩 ⠀ ⠀ | ||
// ⠀ 🌩 V͛o͛͛͛lt͛͛͛i͛͛͛͛so͛͛͛.com⠀ ⠀⠀⠀ | ||
/* eslint-disable no-bitwise */ | ||
import * as ts from 'typescript'; | ||
export function getSymbolPath(symbol) { | ||
if (!symbol) | ||
return []; | ||
if ((symbol.parent?.flags ?? ts.SymbolFlags.ValueModule) & | ||
ts.SymbolFlags.ValueModule) { | ||
return [symbol.escapedName]; | ||
} | ||
return [...getSymbolPath(symbol.parent), symbol.escapedName]; | ||
} | ||
export function collectSymbolNames(node) { | ||
const result = new Set(); | ||
if (ts.isTypeReferenceNode(node) && ts.isIdentifier(node.typeName)) { | ||
result.add(node.typeName.text); | ||
// eslint-disable-next-line @typescript-eslint/no-unsafe-member-access | ||
const symbol = node.typeName?.symbol; | ||
result.add(getSymbolPath(symbol)[0] || node.typeName.text); | ||
} | ||
@@ -9,0 +21,0 @@ node.forEachChild(child => { |
@@ -1,2 +0,2 @@ | ||
// ⠀ⓥ 2022 🌩 🌩 ⠀ ⠀ | ||
// ⠀ⓥ 2023 🌩 🌩 ⠀ ⠀ | ||
// ⠀ 🌩 V͛o͛͛͛lt͛͛͛i͛͛͛͛so͛͛͛.com⠀ ⠀⠀⠀ | ||
@@ -3,0 +3,0 @@ export function getFirstChildOrSelf(node) { |
@@ -1,2 +0,2 @@ | ||
// ⠀ⓥ 2022 🌩 🌩 ⠀ ⠀ | ||
// ⠀ⓥ 2023 🌩 🌩 ⠀ ⠀ | ||
// ⠀ 🌩 V͛o͛͛͛lt͛͛͛i͛͛͛͛so͛͛͛.com⠀ ⠀⠀⠀ | ||
@@ -3,0 +3,0 @@ import { getNodeFullText } from '@voltiso/transform.lib'; |
@@ -1,2 +0,2 @@ | ||
// ⠀ⓥ 2022 🌩 🌩 ⠀ ⠀ | ||
// ⠀ⓥ 2023 🌩 🌩 ⠀ ⠀ | ||
// ⠀ 🌩 V͛o͛͛͛lt͛͛͛i͛͛͛͛so͛͛͛.com⠀ ⠀⠀⠀ | ||
@@ -3,0 +3,0 @@ export function hasNodeOfType(node, kind) { |
@@ -1,2 +0,2 @@ | ||
// ⠀ⓥ 2022 🌩 🌩 ⠀ ⠀ | ||
// ⠀ⓥ 2023 🌩 🌩 ⠀ ⠀ | ||
// ⠀ 🌩 V͛o͛͛͛lt͛͛͛i͛͛͛͛so͛͛͛.com⠀ ⠀⠀⠀ | ||
@@ -3,0 +3,0 @@ export * from './canBeInlined'; |
@@ -1,2 +0,2 @@ | ||
// ⠀ⓥ 2022 🌩 🌩 ⠀ ⠀ | ||
// ⠀ⓥ 2023 🌩 🌩 ⠀ ⠀ | ||
// ⠀ 🌩 V͛o͛͛͛lt͛͛͛i͛͛͛͛so͛͛͛.com⠀ ⠀⠀⠀ | ||
@@ -3,0 +3,0 @@ import { getNodePositionStr, getNodeText } from '@voltiso/transform.lib'; |
@@ -1,6 +0,25 @@ | ||
// ⠀ⓥ 2022 🌩 🌩 ⠀ ⠀ | ||
// ⠀ⓥ 2023 🌩 🌩 ⠀ ⠀ | ||
// ⠀ 🌩 V͛o͛͛͛lt͛͛͛i͛͛͛͛so͛͛͛.com⠀ ⠀⠀⠀ | ||
import { getNodeText } from '@voltiso/transform.lib'; | ||
import * as ts from 'typescript'; | ||
import { getSymbolPath } from '.'; | ||
import { simplifyNode } from './simplifyNode'; | ||
function buildNestedQualifiedName(symbolPath) { | ||
if (symbolPath.length === 1) | ||
return ts.factory.createIdentifier(symbolPath[0]); | ||
return ts.factory.createQualifiedName(buildNestedQualifiedName(symbolPath.slice(0, -1)), symbolPath.at(-1)); | ||
} | ||
function fixNamespaces(ctx, node) { | ||
function visitor(node) { | ||
if (ts.isTypeReferenceNode(node)) { | ||
// eslint-disable-next-line @typescript-eslint/no-unsafe-argument, @typescript-eslint/no-unsafe-member-access | ||
const symbolPath = getSymbolPath(node.typeName.symbol); | ||
if (symbolPath.length === 0) | ||
return node; | ||
return buildNestedQualifiedName(symbolPath); | ||
} | ||
return ts.visitEachChild(node, visitor, ctx.transformationContext); | ||
} | ||
return ts.visitEachChild(node, visitor, ctx.transformationContext); | ||
} | ||
export function simplifyAndAddComment(ctx, originalNode) { | ||
@@ -11,6 +30,8 @@ let node = simplifyNode(ctx, originalNode); | ||
const comment = getNodeText(ctx, ts.getOriginalNode(originalNode)); | ||
if (comment) | ||
if (comment) { | ||
node = ts.addSyntheticLeadingComment(node, ts.SyntaxKind.MultiLineCommentTrivia, ` ${comment} `); | ||
} | ||
node = fixNamespaces(ctx, node); | ||
return node; | ||
} | ||
//# sourceMappingURL=simplifyAndAddComment.js.map |
@@ -1,2 +0,2 @@ | ||
// ⠀ⓥ 2022 🌩 🌩 ⠀ ⠀ | ||
// ⠀ⓥ 2023 🌩 🌩 ⠀ ⠀ | ||
// ⠀ 🌩 V͛o͛͛͛lt͛͛͛i͛͛͛͛so͛͛͛.com⠀ ⠀⠀⠀ | ||
@@ -3,0 +3,0 @@ import * as ts from 'typescript'; |
@@ -1,2 +0,2 @@ | ||
// ⠀ⓥ 2022 🌩 🌩 ⠀ ⠀ | ||
// ⠀ⓥ 2023 🌩 🌩 ⠀ ⠀ | ||
// ⠀ 🌩 V͛o͛͛͛lt͛͛͛i͛͛͛͛so͛͛͛.com⠀ ⠀⠀⠀ | ||
@@ -3,0 +3,0 @@ // eslint-disable-next-line import/no-default-export |
@@ -1,2 +0,2 @@ | ||
// ⠀ⓥ 2022 🌩 🌩 ⠀ ⠀ | ||
// ⠀ⓥ 2023 🌩 🌩 ⠀ ⠀ | ||
// ⠀ 🌩 V͛o͛͛͛lt͛͛͛i͛͛͛͛so͛͛͛.com⠀ ⠀⠀⠀ | ||
@@ -3,0 +3,0 @@ export * from './_'; |
@@ -1,2 +0,2 @@ | ||
// ⠀ⓥ 2022 🌩 🌩 ⠀ ⠀ | ||
// ⠀ⓥ 2023 🌩 🌩 ⠀ ⠀ | ||
// ⠀ 🌩 V͛o͛͛͛lt͛͛͛i͛͛͛͛so͛͛͛.com⠀ ⠀⠀⠀ | ||
@@ -3,0 +3,0 @@ import * as ts from 'typescript'; |
@@ -1,2 +0,2 @@ | ||
// ⠀ⓥ 2022 🌩 🌩 ⠀ ⠀ | ||
// ⠀ⓥ 2023 🌩 🌩 ⠀ ⠀ | ||
// ⠀ 🌩 V͛o͛͛͛lt͛͛͛i͛͛͛͛so͛͛͛.com⠀ ⠀⠀⠀ | ||
@@ -3,0 +3,0 @@ export * from './logStrippedNode'; |
@@ -1,2 +0,2 @@ | ||
// ⠀ⓥ 2022 🌩 🌩 ⠀ ⠀ | ||
// ⠀ⓥ 2023 🌩 🌩 ⠀ ⠀ | ||
// ⠀ 🌩 V͛o͛͛͛lt͛͛͛i͛͛͛͛so͛͛͛.com⠀ ⠀⠀⠀ | ||
@@ -3,0 +3,0 @@ import { getNodePositionStr } from '@voltiso/transform.lib'; |
@@ -1,2 +0,2 @@ | ||
// ⠀ⓥ 2022 🌩 🌩 ⠀ ⠀ | ||
// ⠀ⓥ 2023 🌩 🌩 ⠀ ⠀ | ||
// ⠀ 🌩 V͛o͛͛͛lt͛͛͛i͛͛͛͛so͛͛͛.com⠀ ⠀⠀⠀ | ||
@@ -3,0 +3,0 @@ export function printInitInfo(pluginOptions) { |
@@ -1,2 +0,2 @@ | ||
// ⠀ⓥ 2022 🌩 🌩 ⠀ ⠀ | ||
// ⠀ⓥ 2023 🌩 🌩 ⠀ ⠀ | ||
// ⠀ 🌩 V͛o͛͛͛lt͛͛͛i͛͛͛͛so͛͛͛.com⠀ ⠀⠀⠀ | ||
@@ -3,0 +3,0 @@ export function shouldStripModule(ctx, moduleToStrip) { |
@@ -1,2 +0,2 @@ | ||
// ⠀ⓥ 2022 🌩 🌩 ⠀ ⠀ | ||
// ⠀ⓥ 2023 🌩 🌩 ⠀ ⠀ | ||
// ⠀ 🌩 V͛o͛͛͛lt͛͛͛i͛͛͛͛so͛͛͛.com⠀ ⠀⠀⠀ | ||
@@ -3,0 +3,0 @@ import * as ts from 'typescript'; |
@@ -1,2 +0,2 @@ | ||
// ⠀ⓥ 2022 🌩 🌩 ⠀ ⠀ | ||
// ⠀ⓥ 2023 🌩 🌩 ⠀ ⠀ | ||
// ⠀ 🌩 V͛o͛͛͛lt͛͛͛i͛͛͛͛so͛͛͛.com⠀ ⠀⠀⠀ | ||
@@ -3,0 +3,0 @@ // eslint-disable-next-line import/no-default-export |
@@ -1,2 +0,2 @@ | ||
// ⠀ⓥ 2022 🌩 🌩 ⠀ ⠀ | ||
// ⠀ⓥ 2023 🌩 🌩 ⠀ ⠀ | ||
// ⠀ 🌩 V͛o͛͛͛lt͛͛͛i͛͛͛͛so͛͛͛.com⠀ ⠀⠀⠀ | ||
@@ -3,0 +3,0 @@ export * from './_'; |
@@ -1,2 +0,2 @@ | ||
// ⠀ⓥ 2022 🌩 🌩 ⠀ ⠀ | ||
// ⠀ⓥ 2023 🌩 🌩 ⠀ ⠀ | ||
// ⠀ 🌩 V͛o͛͛͛lt͛͛͛i͛͛͛͛so͛͛͛.com⠀ ⠀⠀⠀ | ||
@@ -3,0 +3,0 @@ import * as ts from 'typescript'; |
{ | ||
"name": "@voltiso/transform", | ||
"version": "3.0.3", | ||
"version": "3.0.4", | ||
"license": "MIT", | ||
@@ -5,0 +5,0 @@ "repository": "git://github.com/voltiso/mono.git", |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
200449
2448