We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 9ced297 commit 788e4dfCopy full SHA for 788e4df
fluent-syntax/src/ast.ts
@@ -47,7 +47,7 @@ export abstract class BaseNode {
47
return true;
48
}
49
50
- clone(): BaseNode {
+ clone(): this {
51
function visit(value: unknown): unknown {
52
if (value instanceof BaseNode) {
53
return value.clone();
@@ -58,7 +58,7 @@ export abstract class BaseNode {
58
return value;
59
60
// eslint-disable-next-line @typescript-eslint/no-unsafe-argument
61
- const clone = Object.create(this.constructor.prototype) as BaseNode;
+ const clone = Object.create(this.constructor.prototype) as this;
62
for (const prop of Object.keys(this)) {
63
clone[prop] = visit(this[prop]);
64
0 commit comments