Skip to content

Commit f4fdfb9

Browse files
authored
Merge pull request #18 from pedramr/master
2 parents 2802a61 + 022ed63 commit f4fdfb9

File tree

3 files changed

+18
-1
lines changed

3 files changed

+18
-1
lines changed

src/transformer.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -253,7 +253,7 @@ function createTransformerFactory(program: ts.Program, options?: Partial<RenameO
253253
throw new Error(`Cannot get symbol for node "${oldProperty.getText()}"`);
254254
}
255255

256-
const oldPropertyName = symbol.escapedName as string;
256+
const oldPropertyName = ts.unescapeLeadingUnderscores(symbol.escapedName);
257257

258258
return createNewNode(oldPropertyName, type, createNode);
259259
}
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
class DoubleUnderscoreProperty {
2+
public __foo: string = "bar";
3+
}
4+
5+
const testObject = new DoubleUnderscoreProperty();
6+
export const foo = testObject.__foo + "baz";
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
"use strict";
2+
Object.defineProperty(exports, "__esModule", { value: true });
3+
exports.foo = void 0;
4+
var DoubleUnderscoreProperty = /** @class */ (function () {
5+
function DoubleUnderscoreProperty() {
6+
this._internal___foo = "bar";
7+
}
8+
return DoubleUnderscoreProperty;
9+
}());
10+
var testObject = new DoubleUnderscoreProperty();
11+
exports.foo = testObject._internal___foo + "baz";

0 commit comments

Comments
 (0)