Skip to content

Commit

Permalink
refactor(rstream-log): minor update matchID()
Browse files Browse the repository at this point in the history
  • Loading branch information
postspectacular committed Apr 18, 2018
1 parent de47493 commit 08af60a
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions packages/rstream-log/src/xform/filter.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,9 @@ export function maxLevel(level: Level): Transducer<LogEntry, LogEntry> {
}

export function matchID(id: string | RegExp): Transducer<LogEntry, LogEntry> {
return isString(id) ?
filter((l) => l[1] === id) :
filter((l) => id.test(l[1]));
return filter(
isString(id) ?
(l) => l[1] === id :
(l) => id.test(l[1])
);
}

0 comments on commit 08af60a

Please sign in to comment.