diff --git a/packages/csp/CHANGELOG.md b/packages/csp/CHANGELOG.md
index 460d8e1287..2ec464b1ae 100644
--- a/packages/csp/CHANGELOG.md
+++ b/packages/csp/CHANGELOG.md
@@ -3,6 +3,14 @@
All notable changes to this project will be documented in this file.
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
+
+## [0.3.46](https://github.com/thi-ng/umbrella/compare/@thi.ng/csp@0.3.45...@thi.ng/csp@0.3.46) (2018-07-03)
+
+
+
+
+**Note:** Version bump only for package @thi.ng/csp
+
## [0.3.45](https://github.com/thi-ng/umbrella/compare/@thi.ng/csp@0.3.44...@thi.ng/csp@0.3.45) (2018-06-21)
diff --git a/packages/csp/package.json b/packages/csp/package.json
index 36e0c11d82..4ec4ebe90f 100644
--- a/packages/csp/package.json
+++ b/packages/csp/package.json
@@ -1,6 +1,6 @@
{
"name": "@thi.ng/csp",
- "version": "0.3.45",
+ "version": "0.3.46",
"description": "ES6 promise based CSP implementation",
"main": "./index.js",
"typings": "./index.d.ts",
@@ -36,7 +36,7 @@
"@thi.ng/checks": "^1.5.5",
"@thi.ng/dcons": "^1.0.5",
"@thi.ng/errors": "^0.1.4",
- "@thi.ng/transducers": "^1.11.1"
+ "@thi.ng/transducers": "^1.12.0"
},
"keywords": [
"async",
diff --git a/packages/hiccup-css/CHANGELOG.md b/packages/hiccup-css/CHANGELOG.md
index db432a47f9..b7f98b5d50 100644
--- a/packages/hiccup-css/CHANGELOG.md
+++ b/packages/hiccup-css/CHANGELOG.md
@@ -3,6 +3,14 @@
All notable changes to this project will be documented in this file.
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
+
+## [0.2.4](https://github.com/thi-ng/umbrella/compare/@thi.ng/hiccup-css@0.2.3...@thi.ng/hiccup-css@0.2.4) (2018-07-03)
+
+
+
+
+**Note:** Version bump only for package @thi.ng/hiccup-css
+
## [0.2.3](https://github.com/thi-ng/umbrella/compare/@thi.ng/hiccup-css@0.2.2...@thi.ng/hiccup-css@0.2.3) (2018-06-21)
diff --git a/packages/hiccup-css/package.json b/packages/hiccup-css/package.json
index f2d4aa488e..26217ba95e 100644
--- a/packages/hiccup-css/package.json
+++ b/packages/hiccup-css/package.json
@@ -1,6 +1,6 @@
{
"name": "@thi.ng/hiccup-css",
- "version": "0.2.3",
+ "version": "0.2.4",
"description": "CSS from nested JS data structures",
"main": "./index.js",
"typings": "./index.d.ts",
@@ -31,7 +31,7 @@
"@thi.ng/api": "^4.0.4",
"@thi.ng/checks": "^1.5.5",
"@thi.ng/errors": "^0.1.4",
- "@thi.ng/transducers": "^1.11.1"
+ "@thi.ng/transducers": "^1.12.0"
},
"keywords": [
"clojure",
diff --git a/packages/rstream-csp/CHANGELOG.md b/packages/rstream-csp/CHANGELOG.md
index 49337b4892..8ebe2b9fe6 100644
--- a/packages/rstream-csp/CHANGELOG.md
+++ b/packages/rstream-csp/CHANGELOG.md
@@ -3,6 +3,14 @@
All notable changes to this project will be documented in this file.
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
+
+## [0.1.80](https://github.com/thi-ng/umbrella/compare/@thi.ng/rstream-csp@0.1.79...@thi.ng/rstream-csp@0.1.80) (2018-07-03)
+
+
+
+
+**Note:** Version bump only for package @thi.ng/rstream-csp
+
## [0.1.79](https://github.com/thi-ng/umbrella/compare/@thi.ng/rstream-csp@0.1.78...@thi.ng/rstream-csp@0.1.79) (2018-07-03)
diff --git a/packages/rstream-csp/package.json b/packages/rstream-csp/package.json
index 8ae07b2fe7..44b453fd64 100644
--- a/packages/rstream-csp/package.json
+++ b/packages/rstream-csp/package.json
@@ -1,6 +1,6 @@
{
"name": "@thi.ng/rstream-csp",
- "version": "0.1.79",
+ "version": "0.1.80",
"description": "@thi.ng/csp bridge module for @thi.ng/rstream",
"main": "./index.js",
"typings": "./index.d.ts",
@@ -28,8 +28,8 @@
"typescript": "^2.8.3"
},
"dependencies": {
- "@thi.ng/csp": "^0.3.45",
- "@thi.ng/rstream": "^1.8.1"
+ "@thi.ng/csp": "^0.3.46",
+ "@thi.ng/rstream": "^1.8.2"
},
"keywords": [
"bridge",
diff --git a/packages/rstream-dot/CHANGELOG.md b/packages/rstream-dot/CHANGELOG.md
index 2faa278040..c2247b236f 100644
--- a/packages/rstream-dot/CHANGELOG.md
+++ b/packages/rstream-dot/CHANGELOG.md
@@ -3,6 +3,14 @@
All notable changes to this project will be documented in this file.
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
+
+## [0.2.19](https://github.com/thi-ng/umbrella/compare/@thi.ng/rstream-dot@0.2.18...@thi.ng/rstream-dot@0.2.19) (2018-07-03)
+
+
+
+
+**Note:** Version bump only for package @thi.ng/rstream-dot
+
## [0.2.18](https://github.com/thi-ng/umbrella/compare/@thi.ng/rstream-dot@0.2.17...@thi.ng/rstream-dot@0.2.18) (2018-07-03)
diff --git a/packages/rstream-dot/package.json b/packages/rstream-dot/package.json
index 82db9a7725..85bc750f5d 100644
--- a/packages/rstream-dot/package.json
+++ b/packages/rstream-dot/package.json
@@ -1,6 +1,6 @@
{
"name": "@thi.ng/rstream-dot",
- "version": "0.2.18",
+ "version": "0.2.19",
"description": "Graphviz DOT conversion of @thi.ng/rstream dataflow graph topologies",
"main": "./index.js",
"typings": "./index.d.ts",
@@ -28,7 +28,7 @@
"typescript": "^2.8.3"
},
"dependencies": {
- "@thi.ng/rstream": "^1.8.1"
+ "@thi.ng/rstream": "^1.8.2"
},
"keywords": [
"conversion",
diff --git a/packages/rstream-gestures/CHANGELOG.md b/packages/rstream-gestures/CHANGELOG.md
index 11e2c954e6..94969a4d93 100644
--- a/packages/rstream-gestures/CHANGELOG.md
+++ b/packages/rstream-gestures/CHANGELOG.md
@@ -3,6 +3,14 @@
All notable changes to this project will be documented in this file.
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
+
+## [0.3.16](https://github.com/thi-ng/umbrella/compare/@thi.ng/rstream-gestures@0.3.15...@thi.ng/rstream-gestures@0.3.16) (2018-07-03)
+
+
+
+
+**Note:** Version bump only for package @thi.ng/rstream-gestures
+
## [0.3.15](https://github.com/thi-ng/umbrella/compare/@thi.ng/rstream-gestures@0.3.14...@thi.ng/rstream-gestures@0.3.15) (2018-07-03)
diff --git a/packages/rstream-gestures/package.json b/packages/rstream-gestures/package.json
index 512929c018..e250727c1d 100644
--- a/packages/rstream-gestures/package.json
+++ b/packages/rstream-gestures/package.json
@@ -1,6 +1,6 @@
{
"name": "@thi.ng/rstream-gestures",
- "version": "0.3.15",
+ "version": "0.3.16",
"description": "Unified mouse, mouse wheel & single-touch event stream abstraction",
"main": "./index.js",
"typings": "./index.d.ts",
@@ -29,8 +29,8 @@
},
"dependencies": {
"@thi.ng/api": "^4.0.4",
- "@thi.ng/rstream": "^1.8.1",
- "@thi.ng/transducers": "^1.11.1"
+ "@thi.ng/rstream": "^1.8.2",
+ "@thi.ng/transducers": "^1.12.0"
},
"keywords": [
"dataflow",
diff --git a/packages/rstream-graph/CHANGELOG.md b/packages/rstream-graph/CHANGELOG.md
index 427183991e..1ac0f1392e 100644
--- a/packages/rstream-graph/CHANGELOG.md
+++ b/packages/rstream-graph/CHANGELOG.md
@@ -3,6 +3,14 @@
All notable changes to this project will be documented in this file.
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
+
+## [2.1.3](https://github.com/thi-ng/umbrella/compare/@thi.ng/rstream-graph@2.1.2...@thi.ng/rstream-graph@2.1.3) (2018-07-03)
+
+
+
+
+**Note:** Version bump only for package @thi.ng/rstream-graph
+
## [2.1.2](https://github.com/thi-ng/umbrella/compare/@thi.ng/rstream-graph@2.1.1...@thi.ng/rstream-graph@2.1.2) (2018-07-03)
diff --git a/packages/rstream-graph/package.json b/packages/rstream-graph/package.json
index a9ff73ca57..37851e6813 100644
--- a/packages/rstream-graph/package.json
+++ b/packages/rstream-graph/package.json
@@ -1,6 +1,6 @@
{
"name": "@thi.ng/rstream-graph",
- "version": "2.1.2",
+ "version": "2.1.3",
"description": "Declarative dataflow graph construction for @thi.ng/rstream",
"main": "./index.js",
"typings": "./index.d.ts",
@@ -33,8 +33,8 @@
"@thi.ng/errors": "^0.1.4",
"@thi.ng/paths": "^1.3.10",
"@thi.ng/resolve-map": "^3.0.2",
- "@thi.ng/rstream": "^1.8.1",
- "@thi.ng/transducers": "^1.11.1"
+ "@thi.ng/rstream": "^1.8.2",
+ "@thi.ng/transducers": "^1.12.0"
},
"keywords": [
"compute",
diff --git a/packages/rstream-graph/test/index.ts b/packages/rstream-graph/test/index.ts
index 461a548328..ab6d50717f 100644
--- a/packages/rstream-graph/test/index.ts
+++ b/packages/rstream-graph/test/index.ts
@@ -63,13 +63,13 @@ describe("rstream-graph", () => {
graph.mul.node.subscribe({ next: (x) => acc.push(x) });
setTimeout(() => {
state.resetIn("a", 10);
- console.log(graph);
+ // console.log(graph);
assert.deepEqual(acc, [600, 1200, 1800, 7200]);
assert.deepEqual(
state.deref(),
{ a: 10, b: 2, foo: { baz: 7200 }, res: { x: 7200, x2: 14400 }, res2: { x: 7200 } }
);
done();
- }, 10);
+ }, 30);
});
});
diff --git a/packages/rstream-log/CHANGELOG.md b/packages/rstream-log/CHANGELOG.md
index 75a10a15ff..4690d66be6 100644
--- a/packages/rstream-log/CHANGELOG.md
+++ b/packages/rstream-log/CHANGELOG.md
@@ -3,6 +3,14 @@
All notable changes to this project will be documented in this file.
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
+
+## [1.0.31](https://github.com/thi-ng/umbrella/compare/@thi.ng/rstream-log@1.0.30...@thi.ng/rstream-log@1.0.31) (2018-07-03)
+
+
+
+
+**Note:** Version bump only for package @thi.ng/rstream-log
+
## [1.0.30](https://github.com/thi-ng/umbrella/compare/@thi.ng/rstream-log@1.0.29...@thi.ng/rstream-log@1.0.30) (2018-07-03)
diff --git a/packages/rstream-log/package.json b/packages/rstream-log/package.json
index bdcf374a40..6f14260e26 100644
--- a/packages/rstream-log/package.json
+++ b/packages/rstream-log/package.json
@@ -1,6 +1,6 @@
{
"name": "@thi.ng/rstream-log",
- "version": "1.0.30",
+ "version": "1.0.31",
"description": "Structured, multilevel & hierarchical loggers based on @thi.ng/rstream",
"main": "./index.js",
"typings": "./index.d.ts",
@@ -31,8 +31,8 @@
"@thi.ng/api": "^4.0.4",
"@thi.ng/checks": "^1.5.5",
"@thi.ng/errors": "^0.1.4",
- "@thi.ng/rstream": "^1.8.1",
- "@thi.ng/transducers": "^1.11.1"
+ "@thi.ng/rstream": "^1.8.2",
+ "@thi.ng/transducers": "^1.12.0"
},
"keywords": [
"ES6",
diff --git a/packages/rstream-query/CHANGELOG.md b/packages/rstream-query/CHANGELOG.md
index cbc705a4a5..2bed2ee07f 100644
--- a/packages/rstream-query/CHANGELOG.md
+++ b/packages/rstream-query/CHANGELOG.md
@@ -3,6 +3,14 @@
All notable changes to this project will be documented in this file.
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
+
+## [0.3.18](https://github.com/thi-ng/umbrella/compare/@thi.ng/rstream-query@0.3.17...@thi.ng/rstream-query@0.3.18) (2018-07-03)
+
+
+
+
+**Note:** Version bump only for package @thi.ng/rstream-query
+
## [0.3.17](https://github.com/thi-ng/umbrella/compare/@thi.ng/rstream-query@0.3.16...@thi.ng/rstream-query@0.3.17) (2018-07-03)
diff --git a/packages/rstream-query/package.json b/packages/rstream-query/package.json
index 53054b24e9..6a944b75cf 100644
--- a/packages/rstream-query/package.json
+++ b/packages/rstream-query/package.json
@@ -1,6 +1,6 @@
{
"name": "@thi.ng/rstream-query",
- "version": "0.3.17",
+ "version": "0.3.18",
"description": "@thi.ng/rstream based triple store & reactive query engine",
"main": "./index.js",
"typings": "./index.d.ts",
@@ -33,9 +33,9 @@
"@thi.ng/checks": "^1.5.5",
"@thi.ng/equiv": "^0.1.5",
"@thi.ng/errors": "^0.1.4",
- "@thi.ng/rstream": "^1.8.1",
- "@thi.ng/rstream-dot": "^0.2.18",
- "@thi.ng/transducers": "^1.11.1"
+ "@thi.ng/rstream": "^1.8.2",
+ "@thi.ng/rstream-dot": "^0.2.19",
+ "@thi.ng/transducers": "^1.12.0"
},
"keywords": [
"dataflow",
diff --git a/packages/rstream/CHANGELOG.md b/packages/rstream/CHANGELOG.md
index 4f6e7a0c28..89ce620fee 100644
--- a/packages/rstream/CHANGELOG.md
+++ b/packages/rstream/CHANGELOG.md
@@ -3,6 +3,14 @@
All notable changes to this project will be documented in this file.
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
+
+## [1.8.2](https://github.com/thi-ng/umbrella/compare/@thi.ng/rstream@1.8.1...@thi.ng/rstream@1.8.2) (2018-07-03)
+
+
+
+
+**Note:** Version bump only for package @thi.ng/rstream
+
## [1.8.1](https://github.com/thi-ng/umbrella/compare/@thi.ng/rstream@1.8.0...@thi.ng/rstream@1.8.1) (2018-07-03)
diff --git a/packages/rstream/package.json b/packages/rstream/package.json
index 2139cfbb34..741718e4d0 100644
--- a/packages/rstream/package.json
+++ b/packages/rstream/package.json
@@ -1,6 +1,6 @@
{
"name": "@thi.ng/rstream",
- "version": "1.8.1",
+ "version": "1.8.2",
"description": "Reactive multi-tap streams, dataflow & transformation pipeline constructs",
"main": "./index.js",
"typings": "./index.d.ts",
@@ -34,7 +34,7 @@
"@thi.ng/checks": "^1.5.5",
"@thi.ng/errors": "^0.1.4",
"@thi.ng/paths": "^1.3.10",
- "@thi.ng/transducers": "^1.11.1"
+ "@thi.ng/transducers": "^1.12.0"
},
"keywords": [
"datastructure",
diff --git a/packages/sax/CHANGELOG.md b/packages/sax/CHANGELOG.md
index ed94deaafc..58474ef46e 100644
--- a/packages/sax/CHANGELOG.md
+++ b/packages/sax/CHANGELOG.md
@@ -3,6 +3,14 @@
All notable changes to this project will be documented in this file.
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
+
+## [0.3.3](https://github.com/thi-ng/umbrella/compare/@thi.ng/sax@0.3.2...@thi.ng/sax@0.3.3) (2018-07-03)
+
+
+
+
+**Note:** Version bump only for package @thi.ng/sax
+
## [0.3.2](https://github.com/thi-ng/umbrella/compare/@thi.ng/sax@0.3.1...@thi.ng/sax@0.3.2) (2018-06-21)
diff --git a/packages/sax/package.json b/packages/sax/package.json
index 2af5e9092b..2bd87c989a 100644
--- a/packages/sax/package.json
+++ b/packages/sax/package.json
@@ -1,6 +1,6 @@
{
"name": "@thi.ng/sax",
- "version": "0.3.2",
+ "version": "0.3.3",
"description": "Transducer-based, SAX-like, non-validating, speedy & tiny XML parser",
"main": "./index.js",
"typings": "./index.d.ts",
@@ -29,8 +29,8 @@
},
"dependencies": {
"@thi.ng/api": "^4.0.4",
- "@thi.ng/transducers": "^1.11.1",
- "@thi.ng/transducers-fsm": "^0.2.2"
+ "@thi.ng/transducers": "^1.12.0",
+ "@thi.ng/transducers-fsm": "^0.2.3"
},
"keywords": [
"ES6",
diff --git a/packages/transducers-fsm/CHANGELOG.md b/packages/transducers-fsm/CHANGELOG.md
index 81bcfffe27..2d70b08504 100644
--- a/packages/transducers-fsm/CHANGELOG.md
+++ b/packages/transducers-fsm/CHANGELOG.md
@@ -3,6 +3,14 @@
All notable changes to this project will be documented in this file.
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
+
+## [0.2.3](https://github.com/thi-ng/umbrella/compare/@thi.ng/transducers-fsm@0.2.2...@thi.ng/transducers-fsm@0.2.3) (2018-07-03)
+
+
+
+
+**Note:** Version bump only for package @thi.ng/transducers-fsm
+
## [0.2.2](https://github.com/thi-ng/umbrella/compare/@thi.ng/transducers-fsm@0.2.1...@thi.ng/transducers-fsm@0.2.2) (2018-06-21)
diff --git a/packages/transducers-fsm/package.json b/packages/transducers-fsm/package.json
index b825ef6d81..f95353bd49 100644
--- a/packages/transducers-fsm/package.json
+++ b/packages/transducers-fsm/package.json
@@ -1,6 +1,6 @@
{
"name": "@thi.ng/transducers-fsm",
- "version": "0.2.2",
+ "version": "0.2.3",
"description": "Transducer-based Finite State Machine transformer",
"main": "./index.js",
"typings": "./index.d.ts",
@@ -29,7 +29,7 @@
},
"dependencies": {
"@thi.ng/api": "^4.0.4",
- "@thi.ng/transducers": "^1.11.1"
+ "@thi.ng/transducers": "^1.12.0"
},
"keywords": [
"ES6",
diff --git a/packages/transducers/CHANGELOG.md b/packages/transducers/CHANGELOG.md
index 954027b8dd..32319661ce 100644
--- a/packages/transducers/CHANGELOG.md
+++ b/packages/transducers/CHANGELOG.md
@@ -3,6 +3,17 @@
All notable changes to this project will be documented in this file.
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
+
+# [1.12.0](https://github.com/thi-ng/umbrella/compare/@thi.ng/transducers@1.11.1...@thi.ng/transducers@1.12.0) (2018-07-03)
+
+
+### Features
+
+* **transducers:** add ensureArray(), refactor reverse() ([677c7cc](https://github.com/thi-ng/umbrella/commit/677c7cc))
+
+
+
+
## [1.11.1](https://github.com/thi-ng/umbrella/compare/@thi.ng/transducers@1.11.0...@thi.ng/transducers@1.11.1) (2018-06-21)
diff --git a/packages/transducers/package.json b/packages/transducers/package.json
index 98645a96f0..d8fc38de86 100644
--- a/packages/transducers/package.json
+++ b/packages/transducers/package.json
@@ -1,6 +1,6 @@
{
"name": "@thi.ng/transducers",
- "version": "1.11.1",
+ "version": "1.12.0",
"description": "Lightweight transducer implementations for ES6 / TypeScript",
"main": "./index.js",
"typings": "./index.d.ts",
diff --git a/packages/transducers/src/func/ensure-array.ts b/packages/transducers/src/func/ensure-array.ts
new file mode 100644
index 0000000000..cf3634d417
--- /dev/null
+++ b/packages/transducers/src/func/ensure-array.ts
@@ -0,0 +1,14 @@
+import { isArray } from "@thi.ng/checks/is-array";
+import { ensureIterable } from "./ensure-iterable";
+
+/**
+ * Helper function to avoid unnecessary copying if `x` is already an
+ * array. First checks if `x` is an array and if so returns it. Else
+ * attempts to obtain an iterator from `x` and if successful collects it
+ * as array and returns it. Throws error if `x` isn't iterable.
+ *
+ * @param x
+ */
+export function ensureArray(x: any): any[] {
+ return isArray(x) ? x : [...ensureIterable(x)];
+}
diff --git a/packages/transducers/src/index.ts b/packages/transducers/src/index.ts
index f6682ae689..b7540df973 100644
--- a/packages/transducers/src/index.ts
+++ b/packages/transducers/src/index.ts
@@ -97,6 +97,7 @@ export * from "./func/compr";
export * from "./func/constantly";
export * from "./func/deep-transform";
export * from "./func/delay";
+export * from "./func/ensure-array";
export * from "./func/ensure-iterable";
export * from "./func/even";
export * from "./func/fuzzy-match";
diff --git a/packages/transducers/src/iter/reverse.ts b/packages/transducers/src/iter/reverse.ts
index 8694f05fb6..332b18ddac 100644
--- a/packages/transducers/src/iter/reverse.ts
+++ b/packages/transducers/src/iter/reverse.ts
@@ -1,20 +1,20 @@
-import { isArrayLike } from "@thi.ng/checks/is-arraylike";
+import { ensureArray } from "../func/ensure-array";
/**
- * Yields iterator producing input in reverse order.
- * Important: Input MUST be finite. Unless an
+ * Yields iterator which consumes input and yield its values in reverse
+ * order. Important: Input MUST be finite.
+ *
* ```
* [...tx.reverse("hello world")]
* // [ "d", "l", "r", "o", "w", " ", "o", "l", "l", "e", "h" ]
* ```
+ *
* @param input
*/
export function* reverse(input: Iterable): IterableIterator {
- if (!isArrayLike(input)) {
- input = [...input];
- }
- let n = (input).length;
+ const _input = ensureArray(input);
+ let n = _input.length;
while (--n >= 0) {
- yield input[n];
+ yield _input[n];
}
}
diff --git a/packages/transducers/src/xform/partition-sync.ts b/packages/transducers/src/xform/partition-sync.ts
index 3a20879cba..14656ffa8f 100644
--- a/packages/transducers/src/xform/partition-sync.ts
+++ b/packages/transducers/src/xform/partition-sync.ts
@@ -37,7 +37,7 @@ import { Reducer, Transducer } from "../api";
*
* ```
* // passing `false` to disable tuple reset
- * [...tx.iterator(tx.partitionSync(["a", "b"], (x) => x[0], false), src)]
+ * [...iterator(partitionSync(["a", "b"], (x) => x[0], false), src)]
* // [ { a: ["a", 2], b: ["b", 10] },
* // { a: ["a", 2], b: ["b", 11] },
* // { a: ["a", 3], b: ["b", 11] } ]