Skip to content

Commit

Permalink
Slight code tweak
Browse files Browse the repository at this point in the history
  • Loading branch information
jakebailey committed Jul 16, 2024
1 parent 6928cd6 commit 8578263
Showing 1 changed file with 4 additions and 6 deletions.
10 changes: 4 additions & 6 deletions src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ export class Task {
private _!: never;

/* @internal */
options: TaskOptions;
readonly options: TaskOptions;

/* @internal */
static create(options: TaskOptions): Task {
Expand All @@ -66,11 +66,9 @@ export class Task {
if (!Array.isArray(options.dependencies) && options.dependencies !== undefined) {
throw new TypeError("Task dependencies is not an array or undefined.");
}
if (options.dependencies) {
for (const dep of options.dependencies) {
if (!(dep instanceof Task)) {
throw new TypeError("Task dependency is not a task.");
}
for (const dep of options.dependencies ?? []) {
if (!(dep instanceof Task)) {
throw new TypeError("Task dependency is not a task.");
}
}

Expand Down

0 comments on commit 8578263

Please sign in to comment.