Skip to content

Commit 15a5b02

Browse files
authored
fix(tasks): satisfy has-own lint rule
1 parent bfcad5e commit 15a5b02

2 files changed

Lines changed: 3 additions & 3 deletions

File tree

src/tasks/task-registry.maintenance.issue-60299.test.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -156,7 +156,7 @@ function createTaskRegistryMaintenanceHarness(params: {
156156
? { terminalSummary: patch.terminalSummary ?? undefined }
157157
: {}),
158158
} satisfies TaskRecord;
159-
if (Object.prototype.hasOwnProperty.call(patch, "error")) {
159+
if (Object.hasOwn(patch, "error")) {
160160
if (patch.error === undefined) {
161161
delete next.error;
162162
} else {

src/tasks/task-registry.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1180,7 +1180,7 @@ function updateTask(taskId: string, patch: Partial<TaskRecord>): TaskRecord | nu
11801180
return null;
11811181
}
11821182
const next = normalizeTaskTimestamps({ ...current, ...patch });
1183-
if (Object.prototype.hasOwnProperty.call(patch, "error") && patch.error === undefined) {
1183+
if (Object.hasOwn(patch, "error") && patch.error === undefined) {
11841184
delete next.error;
11851185
}
11861186
if (isTerminalTaskStatus(next.status) && typeof next.cleanupAfter !== "number") {
@@ -1572,7 +1572,7 @@ export function markTaskTerminalById(params: {
15721572
}
15731573
: {}),
15741574
};
1575-
if (Object.prototype.hasOwnProperty.call(params, "error")) {
1575+
if (Object.hasOwn(params, "error")) {
15761576
patch.error = params.error;
15771577
}
15781578
return updateTask(params.taskId, patch);

0 commit comments

Comments
 (0)