This repository has been archived by the owner. It is now read-only.
Permalink
Browse files

add flat map

  • Loading branch information...
北川
北川 committed Sep 9, 2018
1 parent 0f3738c commit e3163361fed01384c986b9b4c18feb1fc42b8285
Showing with 26 additions and 1 deletion.
  1. +2 −0 index.js
  2. +6 −1 package-lock.json
  3. +1 −0 package.json
  4. +17 −0 test/flatmap.asynct.js
@@ -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')
@@ -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

Some generated files are not rendered by default. Learn more.

Oops, something went wrong.
@@ -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",
@@ -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

This comment has been minimized.

PierreAndreis replied Nov 26, 2018

Damn.

@Mrcooder

This comment has been minimized.

Mrcooder replied Nov 27, 2018

Shame on you

@luck2011

This comment has been minimized.

luck2011 replied Nov 27, 2018

This is evil

@hilongjw

This comment has been minimized.

hilongjw replied Nov 27, 2018

crazy

@xiaohubei

This comment has been minimized.

xiaohubei replied Nov 27, 2018

evil, good job, How much benefits you have earned

@xiaoliang2233

This comment has been minimized.

xiaoliang2233 replied Nov 27, 2018

好气啊

@loliconer

This comment has been minimized.

loliconer replied Nov 27, 2018

真乃小人也!

@juanpablocs

This comment has been minimized.

juanpablocs replied Nov 27, 2018

Esto es malvado!

@helmerdavila

This comment has been minimized.

helmerdavila replied Nov 27, 2018

Top 10 plot twist on Open Source

@cirosantilli

This comment has been minimized.

cirosantilli replied Nov 27, 2018

牛逼

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.