Skip to content

Commit 788e4df

Browse files
committed
fix(fluent-syntax): Use correct TS type for clone() return (#589)
1 parent 9ced297 commit 788e4df

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

fluent-syntax/src/ast.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ export abstract class BaseNode {
4747
return true;
4848
}
4949

50-
clone(): BaseNode {
50+
clone(): this {
5151
function visit(value: unknown): unknown {
5252
if (value instanceof BaseNode) {
5353
return value.clone();
@@ -58,7 +58,7 @@ export abstract class BaseNode {
5858
return value;
5959
}
6060
// eslint-disable-next-line @typescript-eslint/no-unsafe-argument
61-
const clone = Object.create(this.constructor.prototype) as BaseNode;
61+
const clone = Object.create(this.constructor.prototype) as this;
6262
for (const prop of Object.keys(this)) {
6363
clone[prop] = visit(this[prop]);
6464
}

0 commit comments

Comments
 (0)