Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Clarify duplexer-redux problem statement #127

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 7 additions & 7 deletions problems/duplexer_redux/problem.txt
Original file line number Diff line number Diff line change
Expand Up @@ -2,20 +2,20 @@ In this example, you will be given a readable stream, `counter`, as the first
argument to your exported function:

module.exports = function (counter) {
// return a duplex stream to count countries on the writable side
// and pass through `counter` on the readable side
};

Return a duplex stream with the `counter` as the readable side. You will be
written objects with a 2-character `country` field as input, such as these:
Return a duplex stream that captures country objects on its writable side
and that has the `counter` stream as its readable side.

You will be written objects with a 2-character `country` field as input,
such as these:

{"short":"OH","name":"Ohio","country":"US"}
{"name":"West Lothian","country":"GB","region":"Scotland"}
{"short":"NSW","name":"New South Wales","country":"AU"}

Create an object to track the number of occurrences of each unique country code.

For example:
Create an object to track the number of occurrences of each unique country code,
for example:

{"US": 2, "GB": 3, "CN": 1}

Expand Down