Skip to content

Commit

Permalink
prettier. remove noisy log
Browse files Browse the repository at this point in the history
  • Loading branch information
mceachen committed Mar 5, 2019
1 parent 684681e commit b9c2a22
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 7 deletions.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,10 @@ See [Semver](http://semver.org/).
- 🐞 Backwards-compatible bug fixes
- 📦 Minor packaging changes

## v5.3.1

- 📦 Removed `Deferred`'s warn log messages.

## v5.3.0

- 🐞 `.pass` and `.fail` regex now support multiple line outputs per task.
Expand Down
6 changes: 0 additions & 6 deletions src/Deferred.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
import { logger } from "./Logger"

/**
* @see https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise
*/
Expand All @@ -16,9 +14,7 @@ enum State {
*/
export class Deferred<T> {
readonly promise: Promise<T>
// prettier-ignore
private _resolve!: (value?: T) => void
// prettier-ignore
private _reject!: (reason?: any) => void
private state: State = State.pending

Expand Down Expand Up @@ -52,7 +48,6 @@ export class Deferred<T> {

resolve(value?: T): boolean {
if (!this.pending) {
logger().warn("Deferred: resolve when not pending", value)
return false
} else {
this.state = State.fulfilled
Expand All @@ -63,7 +58,6 @@ export class Deferred<T> {

reject(reason?: any): boolean {
if (!this.pending) {
logger().warn("Deferred: reject when not pending", reason)
return false
} else {
this.state = State.rejected
Expand Down
5 changes: 4 additions & 1 deletion src/test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,10 @@ async function onLine(line: string): Promise<void> {
const firstToken = tokens.shift()

// support multi-line outputs:
const postToken = tokens.join(" ").split("<br>").join(newline)
const postToken = tokens
.join(" ")
.split("<br>")
.join(newline)

try {
switch (firstToken) {
Expand Down

0 comments on commit b9c2a22

Please sign in to comment.