Skip to content

Commit

Permalink
fix: type errors
Browse files Browse the repository at this point in the history
  • Loading branch information
dstallenberg committed Aug 7, 2023
1 parent 331cca8 commit 839a766
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 19 deletions.
18 changes: 4 additions & 14 deletions libraries/analysis-javascript/lib/target/TargetVisitor.ts
Original file line number Diff line number Diff line change
Expand Up @@ -560,7 +560,7 @@ export class TargetVisitor extends AbstractSyntaxTreeVisitor {
objectId: string,
typeId: string,
objectName: string,
export_: Export
export_?: Export
) {
const target: ObjectTarget = {
id: objectId,
Expand Down Expand Up @@ -628,12 +628,7 @@ export class TargetVisitor extends AbstractSyntaxTreeVisitor {
} else if (value.isClass()) {
this._extractFromClass(value, id, id, targetName);
} else if (value.isObjectExpression()) {
this._extractFromObjectExpression(
value,
id,
id,
targetName
);
this._extractFromObjectExpression(value, id, id, targetName);
} else {
// TODO
}
Expand All @@ -650,7 +645,7 @@ export class TargetVisitor extends AbstractSyntaxTreeVisitor {
classId: string,
typeId: string,
className: string,
export_: Export | undefined
export_?: Export | undefined
): void {
const target: ClassTarget = {
id: classId,
Expand Down Expand Up @@ -720,12 +715,7 @@ export class TargetVisitor extends AbstractSyntaxTreeVisitor {
} else if (value.isClass()) {
this._extractFromClass(value, id, id, targetName);
} else if (value.isObjectExpression()) {
this._extractFromObjectExpression(
value,
id,
id,
targetName
);
this._extractFromObjectExpression(value, id, id, targetName);
} else {
// TODO
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -159,11 +159,9 @@ export class ObjectStatement extends Statement {
throw new Error(shouldNeverHappen(`Invalid index used index: ${index}`));
}

const keys =
Object.keys(this._object)
.sort()
.filter((key) => this._object[key] !== undefined)
;
const keys = Object.keys(this._object)
.sort()
.filter((key) => this._object[key] !== undefined);
const key = keys[index];

this._object[key] = newChild;
Expand Down

0 comments on commit 839a766

Please sign in to comment.