all repos — archive/homestead @ 6f9b41464f25d12a24b2672dbf12b43c7df81dd2

My future indieweb platform

refactor: Replace stream-array with highland

Works with more than just arrays.  Iterators in particular are useful
Alan Pearce alan@alanpearce.eu
Sun, 25 Jun 2017 13:13:19 +0200
commit

6f9b41464f25d12a24b2672dbf12b43c7df81dd2

parent

b959fe891cc975038a1d34b51192365b55cb7e7e

3 files changed, 11 insertions(+), 11 deletions(-)

jump to
M package.jsonpackage.json
@@ -31,13 +31,13 @@ },   "dependencies": {
     "configly": "^4.1.0",
     "gray-matter": "^2.1.1",
+    "highland": "^2.11.0",
     "koa": "^2.2.0",
     "koa-helmet": "^3.2.0",
     "koa-router": "^7.2.1",
     "koa-send": "^4.1.0",
     "markdown-it": "^8.3.1",
     "rheo": "^2.2.0",
-    "stream-array": "^1.1.2",
     "toml": "^2.3.2"
   }
 }
M src/actions.jssrc/actions.js
@@ -1,11 +1,11 @@ 'use strict'
 
 const send = require('koa-send')
-const streamify = require('stream-array')
+const h = require('highland')
 const responders = require('./responders')
 
 function toArrayStream (iterator) {
-  return streamify(Array.from(iterator.entries()))
+  return h(iterator.entries())
 }
 
 function home (config, posts) {
M yarn.lockyarn.lock
@@ -2162,6 +2162,12 @@ hide-powered-by@1.0.0:   version "1.0.0"
   resolved "https://registry.yarnpkg.com/hide-powered-by/-/hide-powered-by-1.0.0.tgz#4a85ad65881f62857fc70af7174a1184dccce32b"
 
+highland@^2.11.0:
+  version "2.11.0"
+  resolved "https://registry.yarnpkg.com/highland/-/highland-2.11.0.tgz#4d156709c5f10bc31cab6a97c7feb6c373e2466d"
+  dependencies:
+    util-deprecate "^1.0.2"
+
 hoek@2.x.x:
   version "2.16.3"
   resolved "https://registry.yarnpkg.com/hoek/-/hoek-2.16.3.tgz#20bb7403d3cea398e91dc4710a8ff1b8274a25ed"
@@ -3783,7 +3789,7 @@ safe-buffer "~5.0.1"     string_decoder "~1.0.0"
     util-deprecate "~1.0.1"
 
-readable-stream@^2.0.2, readable-stream@^2.0.5, readable-stream@^2.1.5, readable-stream@~2.1.0:
+readable-stream@^2.0.2, readable-stream@^2.0.5, readable-stream@^2.1.5:
   version "2.1.5"
   resolved "https://registry.yarnpkg.com/readable-stream/-/readable-stream-2.1.5.tgz#66fa8b720e1438b364681f2ad1a63c618448c9d0"
   dependencies:
@@ -4231,12 +4237,6 @@ "statuses@>= 1.3.1 < 2", statuses@^1.2.0, statuses@~1.3.1:   version "1.3.1"
   resolved "https://registry.yarnpkg.com/statuses/-/statuses-1.3.1.tgz#faf51b9eb74aaef3b3acf4ad5f61abf24cb7b93e"
 
-stream-array@^1.1.2:
-  version "1.1.2"
-  resolved "https://registry.yarnpkg.com/stream-array/-/stream-array-1.1.2.tgz#9e5f7345f2137c30ee3b498b9114e80b52bb7eb5"
-  dependencies:
-    readable-stream "~2.1.0"
-
 stream-to-observable@^0.1.0:
   version "0.1.0"
   resolved "https://registry.yarnpkg.com/stream-to-observable/-/stream-to-observable-0.1.0.tgz#45bf1d9f2d7dc09bed81f1c307c430e68b84cffe"
@@ -4564,7 +4564,7 @@ resolved "https://registry.yarnpkg.com/user-home/-/user-home-2.0.0.tgz#9c70bfd8169bc1dcbf48604e0f04b8b49cde9e9f"   dependencies:
     os-homedir "^1.0.0"
 
-util-deprecate@~1.0.1:
+util-deprecate@^1.0.2, util-deprecate@~1.0.1:
   version "1.0.2"
   resolved "https://registry.yarnpkg.com/util-deprecate/-/util-deprecate-1.0.2.tgz#450d4dc9fa70de732762fbd2d4a28981419a0ccf"