@eventra_dev/eventra-cli 0.1.1 → 0.1.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,42 +0,0 @@
1
- import { Node, ts } from "ts-morph";
2
-
3
- export type ResolveResult = {
4
- values: string[];
5
- dynamic: boolean;
6
- };
7
-
8
- export function resolveNodeValue(
9
- node: Node,
10
- checker: ts.TypeChecker
11
- ): ResolveResult | null {
12
-
13
- if (Node.isIdentifier(node)) {
14
- const symbol = checker.getSymbolAtLocation(node.compilerNode);
15
- if (!symbol) return null;
16
-
17
- const decls = symbol.getDeclarations() ?? [];
18
-
19
- for (const d of decls) {
20
-
21
- if (ts.isVariableDeclaration(d) && d.initializer) {
22
- if (Node.isStringLiteral(d.initializer as any)) {
23
- return {
24
- values: [(d.initializer as any).text],
25
- dynamic: false
26
- };
27
- }
28
- }
29
-
30
- if (ts.isParameter(d) && d.initializer) {
31
- if (Node.isStringLiteral(d.initializer as any)) {
32
- return {
33
- values: [(d.initializer as any).text],
34
- dynamic: false
35
- };
36
- }
37
- }
38
- }
39
- }
40
-
41
- return null;
42
- }