Skip to content

Commit

Permalink
No commit message
Browse files Browse the repository at this point in the history
  • Loading branch information
NikolaRHristov committed Nov 22, 2024
1 parent f5dc7a4 commit 0cd49ed
Show file tree
Hide file tree
Showing 20 changed files with 61 additions and 12 deletions.
1 change: 1 addition & 0 deletions Example/Input/Block.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
const outer = 1;
{
const inner = 2;

const useInner = inner;
}
const useOuter = outer;
8 changes: 7 additions & 1 deletion Example/Input/Complex.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,9 @@
const condition = true;

const value = condition ? 1 : 2;
const use = value;

let use = value;

let use = value;

const use = value;
8 changes: 5 additions & 3 deletions Example/Input/Complex/Literal.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
const name = "World";
const greeting = `Hello ${name}`;
const use = greeting;
const condition = true;

const result = condition ? "yes" : "no";

const templateStr = `Value is: ${result}`;
5 changes: 5 additions & 0 deletions Example/Input/Complex/Literal/Template.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
const name = "World";

const greeting = `Hello ${name}`;

const use = greeting;
11 changes: 11 additions & 0 deletions Example/Input/Complex/Type.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
type ComplexType<T> = {
value: T;
timestamp: Date;
};

const complex: ComplexType<string> = {
value: "test",
timestamp: new Date(),
};

const usage = complex;
8 changes: 5 additions & 3 deletions Example/Input/Function.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
function test() {
function process() {
const local = 42;
const use = local;
return use;

const usage = local;

return usage;
}
12 changes: 7 additions & 5 deletions Example/Input/Function/Boundary.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,9 @@
const shared = 123;
function one() {
return shared;
const global = 123;

function first() {
return global;
}
function two() {
return shared;

function second() {
return global;
}
1 change: 1 addition & 0 deletions Example/Input/Interface.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,5 @@ interface Test {
prop: string;
}
const obj: Test = { prop: "test" };

const use: Test = obj;
2 changes: 2 additions & 0 deletions Example/Input/Multiple.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
const multi = 123;

const a = multi;

const b = multi;
1 change: 1 addition & 0 deletions Example/Input/Null.ts
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
const nullVal = null;

const use = nullVal;
2 changes: 2 additions & 0 deletions Example/Input/Object.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
const obj = { a: 1, b: 2 };

const { a } = obj;

const use = a;
1 change: 1 addition & 0 deletions Example/Input/Reassigned.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
let x = 1;
x = 2;

const use = x;
2 changes: 2 additions & 0 deletions Example/Input/Simple.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
const a = 1;

const b = a;

const c = b;
console.log(c);
1 change: 1 addition & 0 deletions Example/Input/Simple/Literal.ts
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
const x = 42;

const y = x;
1 change: 1 addition & 0 deletions Example/Input/Simple/Literal/String.ts
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
const str = "hello";

const message = str;
1 change: 1 addition & 0 deletions Example/Input/Simple/Literal/String/Array.ts
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
const arr: Array<string> = ["hello"];

const copy: Array<string> = arr;
1 change: 1 addition & 0 deletions Example/Input/Simple/Literal/Type.ts
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
const x: number = 42;

const y: number = x;
1 change: 1 addition & 0 deletions Example/Input/Undefined.ts
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
const undef = undefined;

const use = undef;
5 changes: 5 additions & 0 deletions Example/Input/VSCode/Predefined.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,14 +9,19 @@ import * as fs from "fs";
import * as path from "path";

const root = path.dirname(path.dirname(__dirname));

const npmrcPath = path.join(root, "remote", ".npmrc");

const npmrc = fs.readFileSync(npmrcPath, "utf8");

const version = /^target="(.*)"$/m.exec(npmrc)![1];

const platform = process.platform;

const arch = process.arch;

const node = platform === "win32" ? "node.exe" : "node";

const nodePath = path.join(
root,
".build",
Expand Down
1 change: 1 addition & 0 deletions Source/Function/Output/Transformer/Visit.ts
Original file line number Diff line number Diff line change
Expand Up @@ -297,6 +297,7 @@ class Transformer {

case ts.isShorthandPropertyAssignment(Node):
const Name = Node.name.text;

const Resolved = this.Resolve(Name, Node);

if (Resolved) {
Expand Down

0 comments on commit 0cd49ed

Please sign in to comment.