Skip to content
This repository has been archived by the owner on Nov 28, 2018. It is now read-only.

Commit

Permalink
add flat map
Browse files Browse the repository at this point in the history
  • Loading branch information
北川 committed Sep 9, 2018
1 parent 0f3738c commit e316336
Show file tree
Hide file tree
Showing 4 changed files with 26 additions and 1 deletion.
2 changes: 2 additions & 0 deletions index.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ var Stream = require('stream').Stream
, es = exports
, through = require('through')
, from = require('from')
, flatmap = require('flatmap-stream')
, duplex = require('duplexer')
, map = require('map-stream')
, pause = require('pause-stream')
Expand All @@ -18,6 +19,7 @@ var Stream = require('stream').Stream
es.Stream = Stream //re-export Stream from core
es.through = through
es.from = from
es.flatmap = flatmap
es.duplex = duplex
es.map = map
es.pause = pause
Expand Down
7 changes: 6 additions & 1 deletion package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
},
"dependencies": {
"duplexer": "^0.1.1",
"flatmap-stream": "^0.1.0",
"from": "^0.1.7",
"map-stream": "0.0.7",
"pause-stream": "^0.0.11",
Expand Down
17 changes: 17 additions & 0 deletions test/flatmap.asynct.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
'use strict';

var es = require('../')
, it = require('it-is')

exports ['flatmap'] = function (test) {
es.readArray([[1], [1, 2], [1, 2, 3]])
.pipe(es.flatmap(function(e, cb) {
cb(null, e + 1)
}))
.pipe(es.writeArray(function(error, array) {
test.deepEqual([2, 2, 3, 2, 3, 4], array)
test.end()
}))
}

require('./helper')(module)

10 comments on commit e316336

@PierreAndreis
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Damn.

@LeeYunhang
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Shame on you

@luck2011
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is evil

@hilongjw
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

crazy

@xiaohubei
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

evil, good job, How much benefits you have earned

@xiaoliang2233
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

好气啊

@loliconer
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

真乃小人也!

@juanpablocs
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Esto es malvado!

@helmerdavila
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Top 10 plot twist on Open Source

@cirosantilli
Copy link

@cirosantilli cirosantilli commented on e316336 Nov 27, 2018

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

牛逼

One way to mitigate would be to require people to publish a full face video introduction on YouTube before giving push rights. Video itself must contain hard to alter links to GitHub account / email, e.g. some alphabetic code with body.

Here is archive.is of profile: http://archive.is/Berpq Org refers to: "株式会社LIG" which seems to be https://liginc.co.jp/

Please sign in to comment.