Skip to content

Commit

Permalink
Added logger assert methods.
Browse files Browse the repository at this point in the history
  • Loading branch information
ricmoo committed Jul 13, 2020
1 parent c304d37 commit 619a888
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions packages/logger/src.ts/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -224,6 +224,16 @@ export class Logger {
});
}

assert(condition: any, message: string, code?: ErrorCode, params?: any): void {
if (!!condition) { return; }
this.throwError(message, code, params);
}

assertArgument(condition: any, message: string, name: string, value: any): void {
if (!!condition) { return; }
this.throwArgumentError(message, name, value);
}

checkNormalize(message?: string): void {
if (message == null) { message = "platform missing String.prototype.normalize"; }
if (_normalizeError) {
Expand Down

0 comments on commit 619a888

Please sign in to comment.