Skip to content

Commit

Permalink
Apply suggestions from code review
Browse files Browse the repository at this point in the history
Co-authored-by: Ian Clanton-Thuon <iclanton@users.noreply.github.com>
  • Loading branch information
aramissennyeydd and iclanton committed May 4, 2024
1 parent 0598f0d commit a526067
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
1 change: 0 additions & 1 deletion common/reviews/api/node-core-library.api.md
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,6 @@ export class Async {
}): Promise<TRetVal[]>;
static runWithRetriesAsync<TResult>({ action, maxRetries, retryDelayMs }: IRunWithRetriesOptions<TResult>): Promise<TResult>;
static sleep(ms: number): Promise<void>;
// (undocumented)
static validateWeightedIterable(operation: IWeighted): void;
}

Expand Down
6 changes: 5 additions & 1 deletion libraries/node-core-library/src/Async.ts
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ export interface IRunWithRetriesOptions<TResult> {

/**
* @remarks
* Used with {@link (Async:class).(forEachAsync:2)}.
* Used with {@link (Async:class).(forEachAsync:2)} and {@link (Async:class).(mapAsync:2)}.
*
* @public
*/
Expand Down Expand Up @@ -322,6 +322,10 @@ export class Async {
}
}

/**
* Ensures that the argument is a valid {@link IWeighted}, with a `weight` argument that
* is a positive integer or 0.
*/
public static validateWeightedIterable(operation: IWeighted): void {
if (operation.weight < 0) {
throw new Error('Weight must be a whole number greater than or equal to 0');
Expand Down

0 comments on commit a526067

Please sign in to comment.