From 763d7b967d2970f1e46a26ea9dee6daa4994022f Mon Sep 17 00:00:00 2001 From: Karsten Schmidt Date: Mon, 11 Feb 2019 13:32:03 +0000 Subject: [PATCH 01/33] perf(geom-isoline): flatten LUTs, manual destructure --- packages/geom-isoline/src/index.ts | 64 ++++++++++++++++-------------- 1 file changed, 35 insertions(+), 29 deletions(-) diff --git a/packages/geom-isoline/src/index.ts b/packages/geom-isoline/src/index.ts index 5e49507adf..7f35d4d2a7 100644 --- a/packages/geom-isoline/src/index.ts +++ b/packages/geom-isoline/src/index.ts @@ -1,17 +1,21 @@ import { range2d } from "@thi.ng/transducers"; import { ReadonlyVec, Vec } from "@thi.ng/vectors"; +// flattened [to,clear] tuples +// all positive values are given as times 2 const EDGE_INDEX = [ - [-1, -1], [2, 0], [1, 0], [1, 0], - [0, 0], [-1, -1], [0, 0], [0, 0], - [3, 0], [2, 0], [-1, -1], [1, 0], - [3, 0], [2, 0], [3, 0], [-1, -1] + -1, -1, 4, 0, 2, 0, 2, 0, + 0, 0, -1, -1, 0, 0, 0, 0, + 6, 0, 4, 0, -1, -1, 2, 0, + 6, 0, 4, 0, 6, 0, -1, -1 ]; -const NEXT_EDGES = [[-1, 0], [0, 1], [1, 0], [0, -1]]; +// flattened coord offsets [x,y] tuples +const NEXT_EDGES = [0, -1, 1, 0, 0, 1, -1, 0]; -const S5 = [[2, 4], [0, 1], [0, 13], [2, 7]]; -const S10 = [[3, 2], [1, 8], [3, 11], [1, 14]]; +// flattened [to,clear] tuples (all values times 2) +const S5 = [4, 8, 0, 2, 0, 26, 4, 14]; +const S10 = [6, 4, 2, 16, 6, 22, 2, 28]; export const setBorder = (src: Vec, w: number, h: number, val: number) => { @@ -36,10 +40,10 @@ const encodeCrossings = for (let y = 0, i = 0; y < h1; y++) { for (let x = 0; x < w1; i++ , x++) { out[i] = - (src[i] < iso ? 8 : 0) | - (src[i + 1] < iso ? 4 : 0) | - (src[i + 1 + w] < iso ? 2 : 0) | - (src[i + w] < iso ? 1 : 0); + (src[i] < iso ? 16 : 0) | + (src[i + 1] < iso ? 8 : 0) | + (src[i + 1 + w] < iso ? 4 : 0) | + (src[i + w] < iso ? 2 : 0); } i++; } @@ -81,11 +85,11 @@ const contourVertex = ( switch (to) { case 0: return [x + mix(src, w, x, y, x + 1, y, iso), y]; - case 1: - return [x + 1, y + mix(src, w, x + 1, y, x + 1, y + 1, iso)]; case 2: + return [x + 1, y + mix(src, w, x + 1, y, x + 1, y + 1, iso)]; + case 4: return [x + mix(src, w, x, y + 1, x + 1, y + 1, iso), y + 1]; - case 3: + case 6: return [x, y + mix(src, w, x, y, x, y + 1, iso)]; default: } @@ -103,6 +107,7 @@ export function* isolines(src: ReadonlyVec, w: number, h: number, iso: number) { const h1 = h - 1; const cells = range2d(h, w); let next: boolean = true; + let idx: number; while (true) { from = to; if (next) { @@ -116,20 +121,21 @@ export function* isolines(src: ReadonlyVec, w: number, h: number, iso: number) { continue; } const i = y * w + x; - const id = coded[i]; - if (id === 5) { - [to, clear] = S5[ - (cellValue(src, w, i) > iso ? 0 : 2) + - (from === 3 ? 0 : 1) - ]; - } else if (id === 10) { - [to, clear] = S10[ - cellValue(src, w, i) > iso ? - (from === 0 ? 0 : 1) : - (from === 2 ? 2 : 3) - ]; + const id = coded[i]; // * 2 + if (id === 10) { + idx = (cellValue(src, w, i) > iso ? 0 : 4) + + (from === 6 ? 0 : 2); + to = S5[idx]; + clear = S5[idx + 1]; + } else if (id === 20) { + idx = cellValue(src, w, i) > iso ? + (from === 0 ? 0 : 2) : + (from === 4 ? 4 : 6); + to = S10[idx]; + clear = S10[idx + 1]; } else { - [to, clear] = EDGE_INDEX[id]; + to = EDGE_INDEX[id]; + clear = EDGE_INDEX[id + 1]; } if (curr.length > 0 && from === -1 && to > -1) { yield curr; @@ -140,8 +146,8 @@ export function* isolines(src: ReadonlyVec, w: number, h: number, iso: number) { } if (to >= 0) { curr.push(contourVertex(src, w, x, y, to, iso)); - y += NEXT_EDGES[to][0]; - x += NEXT_EDGES[to][1]; + x += NEXT_EDGES[to]; + y += NEXT_EDGES[to + 1]; } else { next = true; } From 827588a2119a95d91dd67e84a86243cced383e8d Mon Sep 17 00:00:00 2001 From: Karsten Schmidt Date: Mon, 11 Feb 2019 13:37:20 +0000 Subject: [PATCH 02/33] Publish - @thi.ng/geom-isoline@0.1.2 --- packages/geom-isoline/CHANGELOG.md | 11 +++++++++++ packages/geom-isoline/package.json | 2 +- 2 files changed, 12 insertions(+), 1 deletion(-) diff --git a/packages/geom-isoline/CHANGELOG.md b/packages/geom-isoline/CHANGELOG.md index 5b57bd244c..a01c515907 100644 --- a/packages/geom-isoline/CHANGELOG.md +++ b/packages/geom-isoline/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. +## [0.1.2](https://github.com/thi-ng/umbrella/compare/@thi.ng/geom-isoline@0.1.1...@thi.ng/geom-isoline@0.1.2) (2019-02-11) + + +### Performance Improvements + +* **geom-isoline:** flatten LUTs, manual destructure ([763d7b9](https://github.com/thi-ng/umbrella/commit/763d7b9)) + + + + + ## [0.1.1](https://github.com/thi-ng/umbrella/compare/@thi.ng/geom-isoline@0.1.0...@thi.ng/geom-isoline@0.1.1) (2019-02-10) diff --git a/packages/geom-isoline/package.json b/packages/geom-isoline/package.json index 5c66551520..9939932ecc 100644 --- a/packages/geom-isoline/package.json +++ b/packages/geom-isoline/package.json @@ -1,6 +1,6 @@ { "name": "@thi.ng/geom-isoline", - "version": "0.1.1", + "version": "0.1.2", "description": "Fast 2D contour line extraction / generation", "module": "./index.js", "main": "./lib/index.js", From 7cf98efc392fc5dc6b9d28c7c2dfa5c7429f48a2 Mon Sep 17 00:00:00 2001 From: Karsten Schmidt Date: Tue, 12 Feb 2019 02:52:44 +0000 Subject: [PATCH 03/33] feat(transducers-binary): add utf8Length() --- packages/transducers-binary/src/utf8.ts | 26 +++++++++++++++++++++++++ 1 file changed, 26 insertions(+) diff --git a/packages/transducers-binary/src/utf8.ts b/packages/transducers-binary/src/utf8.ts index 26534f462e..60a6d9603f 100644 --- a/packages/transducers-binary/src/utf8.ts +++ b/packages/transducers-binary/src/utf8.ts @@ -153,3 +153,29 @@ const codePoint = (x) => x < 0x10000 ? String.fromCharCode(x) : (x -= 0x10000, String.fromCharCode(0xd800 | (x >> 10), 0xdc00 | (x & 0x3ff))); + +export const utf8Length = + (str: string) => { + const n = str.length; + let len = 0; + for (let i = 0; i < n; ++i) { + let u = str.charCodeAt(i); + if (u >= 0xd800 && u <= 0xdfff) { + u = 0x10000 + ((u & 0x3ff) << 10) | (str.charCodeAt(++i) & 0x3ff); + } + if (u <= 0x7f) { + len++; + } else if (u <= 0x7ff) { + len += 2; + } else if (u <= 0xffff) { + len += 3; + } else if (u <= 0x1fffff) { + len += 4; + } else if (u <= 0x3ffffff) { + len += 5; + } else { + len += 6; + } + } + return len; + }; From aeb05f8f959508c75a9b592ac9ac722226ac3d4e Mon Sep 17 00:00:00 2001 From: Karsten Schmidt Date: Tue, 12 Feb 2019 02:57:47 +0000 Subject: [PATCH 04/33] feat(fsm): update / split until() BREAKING CHANGE: make until() array based, add untilStr() - rename existing `until()` => `untilStr()` --- packages/fsm/src/until.ts | 39 ++++++++++++++++++++++++++++++++++++++- 1 file changed, 38 insertions(+), 1 deletion(-) diff --git a/packages/fsm/src/until.ts b/packages/fsm/src/until.ts index 5f1588c632..399bac6f25 100644 --- a/packages/fsm/src/until.ts +++ b/packages/fsm/src/until.ts @@ -7,10 +7,12 @@ import { result } from "./result"; * recorded so far (excluding the matched terminator string) and returns * `Match.FULL` result. Else `Match.PARTIAL`. * + * @see until + * * @param str * @param callback */ -export const until = ( +export const untilStr = ( str: string, callback?: LitCallback ): Matcher => @@ -23,3 +25,38 @@ export const until = ( RES_PARTIAL; }; }; + +/** + * Generic array version of `untilStr()`. + * + * @see untilStr + * + * @param str + * @param callback + */ +export const until = ( + str: T[], + callback?: LitCallback +): Matcher => + () => { + let buf: T[] = []; + return (ctx, x) => { + buf.push(x); + return endsWith(buf, str) ? + result(callback && callback(ctx, buf.slice(0, buf.length - str.length))) : + RES_PARTIAL; + }; + }; + +const endsWith = + (src: any[], needle: any[]) => { + let i = src.length; + let j = needle.length; + if (i < j) return false; + for (; --i, --j >= 0;) { + if (src[i] !== needle[j]) { + return false; + } + } + return true; + }; From e8cd24227d859700716b61fbafe1680ef998b3a0 Mon Sep 17 00:00:00 2001 From: Karsten Schmidt Date: Tue, 12 Feb 2019 02:58:29 +0000 Subject: [PATCH 05/33] refactor(hiccup-markdown): update fsm until() usage --- packages/hiccup-markdown/src/parse.ts | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/packages/hiccup-markdown/src/parse.ts b/packages/hiccup-markdown/src/parse.ts index 937537c9e8..359288c269 100644 --- a/packages/hiccup-markdown/src/parse.ts +++ b/packages/hiccup-markdown/src/parse.ts @@ -6,7 +6,7 @@ import { ResultBody, seq, str, - until, + untilStr, whitespace } from "@thi.ng/fsm"; import { peek } from "@thi.ng/transducers"; @@ -217,9 +217,9 @@ const matchLink = (result: (href, body) => any[]) => seq( [ - until(LINK_LABEL_END, (ctx, body) => (ctx.title = body, null)), + untilStr(LINK_LABEL_END, (ctx, body) => (ctx.title = body, null)), str(LINK_HREF), - until(LINK_HREF_END, (ctx, body) => (ctx.href = body, null)), + untilStr(LINK_HREF_END, (ctx, body) => (ctx.href = body, null)), ], pop((ctx) => result(ctx.href, ctx.title)) ); @@ -343,10 +343,10 @@ export const parse = (tags?: Partial) => { ), [State.START_CODEBLOCK]: - until(NL, (ctx, lang) => (ctx.lang = lang, [State.CODEBLOCK])), + untilStr(NL, (ctx, lang) => (ctx.lang = lang, [State.CODEBLOCK])), [State.CODEBLOCK]: - until(CODEBLOCK_END, collectCodeBlock(tags.codeblock)), + untilStr(CODEBLOCK_END, collectCodeBlock(tags.codeblock)), [State.LI]: matchPara(State.LI, State.END_LI), @@ -367,16 +367,16 @@ export const parse = (tags?: Partial) => { matchLink(tags.img), [State.STRONG]: - until(STRONG, collectInline(tags.strong)), + untilStr(STRONG, collectInline(tags.strong)), [State.STRIKE]: - until(STRIKE, collectInline(tags.strike)), + untilStr(STRIKE, collectInline(tags.strike)), [State.EMPHASIS]: - until(EM, collectInline(tags.em)), + untilStr(EM, collectInline(tags.em)), [State.CODE]: - until(CODE, collectInline(tags.code)), + untilStr(CODE, collectInline(tags.code)), [State.TABLE]: alts( From c1bbc6f631af584c5ec91f9e5f90e0f83b9a7b77 Mon Sep 17 00:00:00 2001 From: Karsten Schmidt Date: Tue, 12 Feb 2019 03:00:13 +0000 Subject: [PATCH 06/33] feat(bencode): add decode(), fix string length handling - add decode() w/ opt utf8 string decoding - use utf8Length() for string encoding --- packages/bencode/package.json | 3 +- packages/bencode/src/index.ts | 159 +++++++++++++++++++++++++++++++++- 2 files changed, 157 insertions(+), 5 deletions(-) diff --git a/packages/bencode/package.json b/packages/bencode/package.json index 5fe1a242b1..5ba528123b 100644 --- a/packages/bencode/package.json +++ b/packages/bencode/package.json @@ -35,6 +35,7 @@ "@thi.ng/api": "^5.0.2", "@thi.ng/checks": "^2.1.0", "@thi.ng/defmulti": "^1.0.2", + "@thi.ng/errors": "^1.0.2", "@thi.ng/transducers": "^4.0.1", "@thi.ng/transducers-binary": "^0.1.1" }, @@ -52,4 +53,4 @@ "access": "public" }, "sideEffects": false -} +} \ No newline at end of file diff --git a/packages/bencode/src/index.ts b/packages/bencode/src/index.ts index ea990295e1..aa2b5c8b45 100644 --- a/packages/bencode/src/index.ts +++ b/packages/bencode/src/index.ts @@ -1,19 +1,23 @@ import { assert } from "@thi.ng/api"; import { + isArray, isArrayLike, isBoolean, isNumber, isPlainObject, - isString, + isString } from "@thi.ng/checks"; import { defmulti } from "@thi.ng/defmulti"; -import { mapcat } from "@thi.ng/transducers"; +import { illegalState } from "@thi.ng/errors"; +import { mapcat, peek } from "@thi.ng/transducers"; import { BinStructItem, bytes, str, u8, - u8array + u8array, + utf8Decode, + utf8Length } from "@thi.ng/transducers-binary"; const enum Type { @@ -25,6 +29,19 @@ const enum Type { LIST }; +const enum Lit { + MINUS = 0x2d, + DOT = 0x2e, + ZERO = 0x30, + NINE = 0x39, + COLON = 0x3a, + DICT = 0x64, + END = 0x65, + FLOAT = 0x66, + INT = 0x69, + LIST = 0x6c, +} + const FLOAT_RE = /^[0-9.-]+$/; export const encode = (x: any, cap = 1024) => @@ -66,7 +83,7 @@ encodeBin.addAll({ [Type.STR]: (x: string) => - [str(x.length + ":" + x)], + [str(utf8Length(x) + ":" + x)], [Type.LIST]: (x: Iterable) => @@ -81,3 +98,137 @@ encodeBin.addAll({ u8(0x65) ] }); + +export const decode = + (buf: Iterable, utf8 = true) => { + const iter = buf[Symbol.iterator](); + const stack = []; + let i: IteratorResult; + let x: any; + while (!(i = iter.next()).done) { + x = i.value; + switch (x) { + case Lit.DICT: + ensureNotKey(stack, "dict"); + stack.push({ type: Type.DICT, val: {} }); + break; + case Lit.LIST: + ensureNotKey(stack, "list"); + stack.push({ type: Type.LIST, val: [] }); + break; + case Lit.INT: + x = collect(stack, readInt(iter, 0)); + if (x !== undefined) { + return x; + } + break; + case Lit.FLOAT: + x = collect(stack, readFloat(iter)); + if (x !== undefined) { + return x; + } + break; + case Lit.END: + x = stack.pop(); + if (x) { + const parent = peek(stack); + if (parent) { + if (parent.type === Type.LIST) { + parent.val.push(x.val); + } else if (parent.type === Type.DICT) { + parent.val[parent.key] = x.val; + parent.key = null; + } + } else { + return x.val; + } + } else { + illegalState("unmatched end literal"); + } + break; + default: + if (x >= Lit.ZERO && x <= Lit.NINE) { + x = readBytes(iter, readInt(iter, x - Lit.ZERO, Lit.COLON)); + x = collect(stack, x, utf8); + if (x !== undefined) { + return x; + } + } else { + illegalState(`unexpected value type: 0x${i.value.toString(16)}`); + } + } + } + return peek(stack).val; + }; + +const ensureNotKey = + (stack: any[], type: string) => { + const x = peek(stack); + assert( + !x || x.type !== Type.DICT || x.key, + type + " not supported as dict key" + ); + }; + +const collect = + (stack: any[], x: any, utf8 = false) => { + const parent = peek(stack); + if (!parent) return x; + if (parent.type === Type.LIST) { + parent.val.push(x); + } else { + if (!parent.key) { + parent.key = isArray(x) ? utf8Decode(x) : x; + } else { + parent.val[parent.key] = utf8 ? utf8Decode(x) : x; + parent.key = null; + } + } + }; + +const readInt = + (iter: Iterator, acc: number, end = Lit.END) => { + let i: IteratorResult; + let x: number; + while (!(i = iter.next()).done) { + x = i.value; + if (x >= Lit.ZERO && x <= Lit.NINE) { + acc = acc * 10 + x - Lit.ZERO; + } else if (x === end) { + return acc; + } else { + illegalState(`expected digit, got 0x${x.toString(16)}`); + } + } + illegalState(`incomplete int`); + }; + +const readFloat = + (iter: Iterator) => { + let i: IteratorResult; + let x: number; + let acc = ""; + while (!(i = iter.next()).done) { + x = i.value; + if ((x >= Lit.ZERO && x <= Lit.NINE) || x === Lit.DOT || x === Lit.MINUS) { + acc += String.fromCharCode(x); + } else if (x === Lit.END) { + return parseFloat(acc); + } else { + illegalState(`expected digit or dot, got 0x${x.toString(16)}`); + } + } + illegalState(`incomplete float`); + }; + +const readBytes = + (iter: Iterator, len: number) => { + let i: IteratorResult; + let buf: number[] = []; + while (--len >= 0 && !(i = iter.next()).done) { + buf.push(i.value); + } + return len < 0 ? + buf : + illegalState(`expected string, reached EOF`); + }; From 361ba37309c276412257c3b84c8377ff4be1378c Mon Sep 17 00:00:00 2001 From: Karsten Schmidt Date: Tue, 12 Feb 2019 14:37:04 +0000 Subject: [PATCH 07/33] feat(arrays): extract as new package --- packages/arrays/.npmignore | 12 ++ packages/arrays/LICENSE | 201 +++++++++++++++++++++++++ packages/arrays/README.md | 65 ++++++++ packages/arrays/package.json | 55 +++++++ packages/arrays/src/binary-search.ts | 41 +++++ packages/arrays/src/ends-with.ts | 10 ++ packages/arrays/src/ensure-array.ts | 18 +++ packages/arrays/src/ensure-iterable.ts | 9 ++ packages/arrays/src/fuzzy-match.ts | 44 ++++++ packages/arrays/src/index.ts | 9 ++ packages/arrays/src/peek.ts | 7 + packages/arrays/src/shuffle.ts | 17 +++ packages/arrays/src/starts-with.ts | 10 ++ packages/arrays/src/swizzle.ts | 55 +++++++ packages/arrays/test/index.ts | 6 + packages/arrays/test/tsconfig.json | 11 ++ packages/arrays/tsconfig.json | 11 ++ 17 files changed, 581 insertions(+) create mode 100644 packages/arrays/.npmignore create mode 100644 packages/arrays/LICENSE create mode 100644 packages/arrays/README.md create mode 100644 packages/arrays/package.json create mode 100644 packages/arrays/src/binary-search.ts create mode 100644 packages/arrays/src/ends-with.ts create mode 100644 packages/arrays/src/ensure-array.ts create mode 100644 packages/arrays/src/ensure-iterable.ts create mode 100644 packages/arrays/src/fuzzy-match.ts create mode 100644 packages/arrays/src/index.ts create mode 100644 packages/arrays/src/peek.ts create mode 100644 packages/arrays/src/shuffle.ts create mode 100644 packages/arrays/src/starts-with.ts create mode 100644 packages/arrays/src/swizzle.ts create mode 100644 packages/arrays/test/index.ts create mode 100644 packages/arrays/test/tsconfig.json create mode 100644 packages/arrays/tsconfig.json diff --git a/packages/arrays/.npmignore b/packages/arrays/.npmignore new file mode 100644 index 0000000000..74ea62d1fa --- /dev/null +++ b/packages/arrays/.npmignore @@ -0,0 +1,12 @@ +.meta +.nyc_output +*.html +*.tgz +build +coverage +dev +doc +export +src* +test +tsconfig.json diff --git a/packages/arrays/LICENSE b/packages/arrays/LICENSE new file mode 100644 index 0000000000..8dada3edaf --- /dev/null +++ b/packages/arrays/LICENSE @@ -0,0 +1,201 @@ + Apache License + Version 2.0, January 2004 + http://www.apache.org/licenses/ + + TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION + + 1. Definitions. + + "License" shall mean the terms and conditions for use, reproduction, + and distribution as defined by Sections 1 through 9 of this document. + + "Licensor" shall mean the copyright owner or entity authorized by + the copyright owner that is granting the License. + + "Legal Entity" shall mean the union of the acting entity and all + other entities that control, are controlled by, or are under common + control with that entity. For the purposes of this definition, + "control" means (i) the power, direct or indirect, to cause the + direction or management of such entity, whether by contract or + otherwise, or (ii) ownership of fifty percent (50%) or more of the + outstanding shares, or (iii) beneficial ownership of such entity. + + "You" (or "Your") shall mean an individual or Legal Entity + exercising permissions granted by this License. + + "Source" form shall mean the preferred form for making modifications, + including but not limited to software source code, documentation + source, and configuration files. + + "Object" form shall mean any form resulting from mechanical + transformation or translation of a Source form, including but + not limited to compiled object code, generated documentation, + and conversions to other media types. + + "Work" shall mean the work of authorship, whether in Source or + Object form, made available under the License, as indicated by a + copyright notice that is included in or attached to the work + (an example is provided in the Appendix below). + + "Derivative Works" shall mean any work, whether in Source or Object + form, that is based on (or derived from) the Work and for which the + editorial revisions, annotations, elaborations, or other modifications + represent, as a whole, an original work of authorship. For the purposes + of this License, Derivative Works shall not include works that remain + separable from, or merely link (or bind by name) to the interfaces of, + the Work and Derivative Works thereof. + + "Contribution" shall mean any work of authorship, including + the original version of the Work and any modifications or additions + to that Work or Derivative Works thereof, that is intentionally + submitted to Licensor for inclusion in the Work by the copyright owner + or by an individual or Legal Entity authorized to submit on behalf of + the copyright owner. For the purposes of this definition, "submitted" + means any form of electronic, verbal, or written communication sent + to the Licensor or its representatives, including but not limited to + communication on electronic mailing lists, source code control systems, + and issue tracking systems that are managed by, or on behalf of, the + Licensor for the purpose of discussing and improving the Work, but + excluding communication that is conspicuously marked or otherwise + designated in writing by the copyright owner as "Not a Contribution." + + "Contributor" shall mean Licensor and any individual or Legal Entity + on behalf of whom a Contribution has been received by Licensor and + subsequently incorporated within the Work. + + 2. Grant of Copyright License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + copyright license to reproduce, prepare Derivative Works of, + publicly display, publicly perform, sublicense, and distribute the + Work and such Derivative Works in Source or Object form. + + 3. Grant of Patent License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + (except as stated in this section) patent license to make, have made, + use, offer to sell, sell, import, and otherwise transfer the Work, + where such license applies only to those patent claims licensable + by such Contributor that are necessarily infringed by their + Contribution(s) alone or by combination of their Contribution(s) + with the Work to which such Contribution(s) was submitted. If You + institute patent litigation against any entity (including a + cross-claim or counterclaim in a lawsuit) alleging that the Work + or a Contribution incorporated within the Work constitutes direct + or contributory patent infringement, then any patent licenses + granted to You under this License for that Work shall terminate + as of the date such litigation is filed. + + 4. Redistribution. You may reproduce and distribute copies of the + Work or Derivative Works thereof in any medium, with or without + modifications, and in Source or Object form, provided that You + meet the following conditions: + + (a) You must give any other recipients of the Work or + Derivative Works a copy of this License; and + + (b) You must cause any modified files to carry prominent notices + stating that You changed the files; and + + (c) You must retain, in the Source form of any Derivative Works + that You distribute, all copyright, patent, trademark, and + attribution notices from the Source form of the Work, + excluding those notices that do not pertain to any part of + the Derivative Works; and + + (d) If the Work includes a "NOTICE" text file as part of its + distribution, then any Derivative Works that You distribute must + include a readable copy of the attribution notices contained + within such NOTICE file, excluding those notices that do not + pertain to any part of the Derivative Works, in at least one + of the following places: within a NOTICE text file distributed + as part of the Derivative Works; within the Source form or + documentation, if provided along with the Derivative Works; or, + within a display generated by the Derivative Works, if and + wherever such third-party notices normally appear. The contents + of the NOTICE file are for informational purposes only and + do not modify the License. You may add Your own attribution + notices within Derivative Works that You distribute, alongside + or as an addendum to the NOTICE text from the Work, provided + that such additional attribution notices cannot be construed + as modifying the License. + + You may add Your own copyright statement to Your modifications and + may provide additional or different license terms and conditions + for use, reproduction, or distribution of Your modifications, or + for any such Derivative Works as a whole, provided Your use, + reproduction, and distribution of the Work otherwise complies with + the conditions stated in this License. + + 5. Submission of Contributions. Unless You explicitly state otherwise, + any Contribution intentionally submitted for inclusion in the Work + by You to the Licensor shall be under the terms and conditions of + this License, without any additional terms or conditions. + Notwithstanding the above, nothing herein shall supersede or modify + the terms of any separate license agreement you may have executed + with Licensor regarding such Contributions. + + 6. Trademarks. This License does not grant permission to use the trade + names, trademarks, service marks, or product names of the Licensor, + except as required for reasonable and customary use in describing the + origin of the Work and reproducing the content of the NOTICE file. + + 7. Disclaimer of Warranty. Unless required by applicable law or + agreed to in writing, Licensor provides the Work (and each + Contributor provides its Contributions) on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or + implied, including, without limitation, any warranties or conditions + of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A + PARTICULAR PURPOSE. You are solely responsible for determining the + appropriateness of using or redistributing the Work and assume any + risks associated with Your exercise of permissions under this License. + + 8. Limitation of Liability. In no event and under no legal theory, + whether in tort (including negligence), contract, or otherwise, + unless required by applicable law (such as deliberate and grossly + negligent acts) or agreed to in writing, shall any Contributor be + liable to You for damages, including any direct, indirect, special, + incidental, or consequential damages of any character arising as a + result of this License or out of the use or inability to use the + Work (including but not limited to damages for loss of goodwill, + work stoppage, computer failure or malfunction, or any and all + other commercial damages or losses), even if such Contributor + has been advised of the possibility of such damages. + + 9. Accepting Warranty or Additional Liability. While redistributing + the Work or Derivative Works thereof, You may choose to offer, + and charge a fee for, acceptance of support, warranty, indemnity, + or other liability obligations and/or rights consistent with this + License. However, in accepting such obligations, You may act only + on Your own behalf and on Your sole responsibility, not on behalf + of any other Contributor, and only if You agree to indemnify, + defend, and hold each Contributor harmless for any liability + incurred by, or claims asserted against, such Contributor by reason + of your accepting any such warranty or additional liability. + + END OF TERMS AND CONDITIONS + + APPENDIX: How to apply the Apache License to your work. + + To apply the Apache License to your work, attach the following + boilerplate notice, with the fields enclosed by brackets "{}" + replaced with your own identifying information. (Don't include + the brackets!) The text should be enclosed in the appropriate + comment syntax for the file format. We also recommend that a + file or class name and description of purpose be included on the + same "printed page" as the copyright notice for easier + identification within third-party archives. + + Copyright {yyyy} {name of copyright owner} + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. diff --git a/packages/arrays/README.md b/packages/arrays/README.md new file mode 100644 index 0000000000..1a1b2c16bc --- /dev/null +++ b/packages/arrays/README.md @@ -0,0 +1,65 @@ +# @thi.ng/arrays + +[![npm (scoped)](https://img.shields.io/npm/v/@thi.ng/arrays.svg)](https://www.npmjs.com/package/@thi.ng/arrays) +![npm downloads](https://img.shields.io/npm/dm/@thi.ng/arrays.svg) +[![Twitter Follow](https://img.shields.io/twitter/follow/thing_umbrella.svg?style=flat-square&label=twitter)](https://twitter.com/thing_umbrella) + +This project is part of the +[@thi.ng/umbrella](https://github.com/thi-ng/umbrella/) monorepo. + + + +- [About](#about) +- [Installation](#installation) +- [Dependencies](#dependencies) +- [Usage examples](#usage-examples) +- [API](#api) +- [Authors](#authors) +- [License](#license) + + + +## About + +Array & ArrayLike utilities. + +## Installation + +```bash +yarn add @thi.ng/arrays +``` + +## Dependencies + +- [@thi.ng/api](https://github.com/thi-ng/umbrella/tree/master/packages/api) +- [@thi.ng/checks](https://github.com/thi-ng/umbrella/tree/master/packages/checks) +- [@thi.ng/compare](https://github.com/thi-ng/umbrella/tree/master/packages/compare) +- [@thi.ng/equiv](https://github.com/thi-ng/umbrella/tree/master/packages/equiv) +- [@thi.ng/errors](https://github.com/thi-ng/umbrella/tree/master/packages/errors) +- [@thi.ng/random](https://github.com/thi-ng/umbrella/tree/master/packages/random) + +## Usage examples + +```ts +import * as a from "@thi.ng/arrays"; +``` + +## API + +- [binarySearch()](https://github.com/thi-ng/umbrella/tree/master/packages/arrays/src/binary-search.ts) +- [endsWith()](https://github.com/thi-ng/umbrella/tree/master/packages/arrays/src/ends-with.ts) +- [ensureArray()](https://github.com/thi-ng/umbrella/tree/master/packages/arrays/src/ensure-array.ts) +- [ensureIterable()](https://github.com/thi-ng/umbrella/tree/master/packages/arrays/src/ensure-iterable.ts) +- [fuzzyMatch()](https://github.com/thi-ng/umbrella/tree/master/packages/arrays/src/fuzzy-match.ts) +- [peek()](https://github.com/thi-ng/umbrella/tree/master/packages/arrays/src/peek.ts) +- [shuffle()](https://github.com/thi-ng/umbrella/tree/master/packages/arrays/src/shuffle.ts) (w/ custom PRNG support) +- [startsWith()](https://github.com/thi-ng/umbrella/tree/master/packages/arrays/src/starts-with.ts) +- [swizzle()](https://github.com/thi-ng/umbrella/tree/master/packages/arrays/src/swizzle.ts) + +## Authors + +- Karsten Schmidt + +## License + +© 2018 Karsten Schmidt // Apache Software License 2.0 diff --git a/packages/arrays/package.json b/packages/arrays/package.json new file mode 100644 index 0000000000..3954409541 --- /dev/null +++ b/packages/arrays/package.json @@ -0,0 +1,55 @@ +{ + "name": "@thi.ng/arrays", + "version": "0.0.1", + "description": "Array / Arraylike utilities", + "module": "./index.js", + "main": "./lib/index.js", + "umd:main": "./lib/index.umd.js", + "typings": "./index.d.ts", + "repository": { + "type": "git", + "url": "https://github.com/thi-ng/umbrella.git" + }, + "homepage": "https://github.com/thi-ng/umbrella/tree/master/packages/arrays", + "author": "Karsten Schmidt ", + "license": "Apache-2.0", + "scripts": { + "build": "yarn clean && yarn build:es6 && yarn build:bundle", + "build:es6": "tsc --declaration", + "build:bundle": "../../scripts/bundle-module", + "test": "rimraf build && tsc -p test/tsconfig.json && nyc mocha build/test/*.js", + "clean": "rimraf *.js *.d.ts .nyc_output build coverage doc lib", + "cover": "yarn test && nyc report --reporter=lcov", + "doc": "node_modules/.bin/typedoc --mode modules --out doc src", + "pub": "yarn build && yarn publish --access public" + }, + "devDependencies": { + "@types/mocha": "^5.2.5", + "@types/node": "^10.12.15", + "mocha": "^5.2.0", + "nyc": "^13.1.0", + "typedoc": "^0.14.0", + "typescript": "^3.2.2" + }, + "dependencies": { + "@thi.ng/api": "^5.0.1", + "@thi.ng/checks": "^2.1.0", + "@thi.ng/compare": "^1.0.2", + "@thi.ng/equiv": "^1.0.2", + "@thi.ng/errors": "^1.0.2", + "@thi.ng/random": "^1.0.2" + }, + "keywords": [ + "arrays", + "binary search", + "ES6", + "fuzzy search", + "shuffle", + "swizzle", + "typescript" + ], + "publishConfig": { + "access": "public" + }, + "sideEffects": false +} \ No newline at end of file diff --git a/packages/arrays/src/binary-search.ts b/packages/arrays/src/binary-search.ts new file mode 100644 index 0000000000..5c94498386 --- /dev/null +++ b/packages/arrays/src/binary-search.ts @@ -0,0 +1,41 @@ +import { Comparator, Fn } from "@thi.ng/api"; +import { compare } from "@thi.ng/compare"; + +/** + * Returns the supposed index of `x` in pre-sorted array-like collection + * `buf`. If `x` can't be found, returns `-index-1`. + * + * The optional `key` function is used to obtain the actual sort value + * of `x` and each array item (default: identity). + * + * The optional `cmp` comparator (default: thi.ng/compare) is then used + * to identify the index of `x`. The sort order of `buf` MUST be + * compatible with that of `cmp`. + * + * @param x + * @param buf + * @param key + * @param cmp + */ +export const binarySearch = ( + x: A, + buf: ArrayLike, + key: Fn = (x) => x, + cmp: Comparator = compare, +) => { + const kx = key(x); + let low = 0; + let high = buf.length - 1; + while (low <= high) { + const mid = (low + high) >>> 1; + const c = cmp(key(buf[mid]), kx); + if (c < 0) { + low = mid + 1; + } else if (c > 0) { + high = mid - 1; + } else { + return mid; + } + } + return -low - 1; +}; diff --git a/packages/arrays/src/ends-with.ts b/packages/arrays/src/ends-with.ts new file mode 100644 index 0000000000..7c60368fc2 --- /dev/null +++ b/packages/arrays/src/ends-with.ts @@ -0,0 +1,10 @@ +import { equiv as _eq } from "@thi.ng/equiv"; + +export const endsWith = + (buf: ArrayLike, needle: ArrayLike, equiv = _eq) => { + let i = buf.length; + let j = needle.length; + if (i < j) return false; + while (--i, --j >= 0 && equiv(buf[i], needle[j])) { } + return j < 0; + }; diff --git a/packages/arrays/src/ensure-array.ts b/packages/arrays/src/ensure-array.ts new file mode 100644 index 0000000000..0de070f414 --- /dev/null +++ b/packages/arrays/src/ensure-array.ts @@ -0,0 +1,18 @@ +import { isArray, isArrayLike } from "@thi.ng/checks"; +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 const ensureArray = + (x: any): any[] => + isArray(x) ? x : [...ensureIterable(x)]; + +export const ensureArrayLike = + (x: any): ArrayLike => + isArrayLike(x) ? x : [...ensureIterable(x)]; diff --git a/packages/arrays/src/ensure-iterable.ts b/packages/arrays/src/ensure-iterable.ts new file mode 100644 index 0000000000..dd9acf06c5 --- /dev/null +++ b/packages/arrays/src/ensure-iterable.ts @@ -0,0 +1,9 @@ +import { illegalArgs } from "@thi.ng/errors"; + +export const ensureIterable = + (x: any): IterableIterator => { + if (!(x != null && x[Symbol.iterator])) { + illegalArgs(`value is not iterable: ${x}`); + } + return x; + }; diff --git a/packages/arrays/src/fuzzy-match.ts b/packages/arrays/src/fuzzy-match.ts new file mode 100644 index 0000000000..1ef5a598be --- /dev/null +++ b/packages/arrays/src/fuzzy-match.ts @@ -0,0 +1,44 @@ +import { Predicate2 } from "@thi.ng/api"; +import { equiv as _eq } from "@thi.ng/equiv"; + +/** + * Performs a fuzzy search of `query` in `domain` and returns `true` if + * successful. + * + * The optional `equiv` predicate can be used to customize + * item equality checking. Uses @thi.ng/equiv by default. + * + * Adapted and generalized from: + * https://github.com/bevacqua/fufuzzyzzysearch (MIT) + * + * @see thi.ng/transducers/xform/filterFuzzy + * + * @param query + * @param domain + * @param equiv + */ +export const fuzzyMatch = ( + query: ArrayLike, + domain: ArrayLike, + equiv: Predicate2 = _eq +) => { + const nd = domain.length; + const nq = query.length; + if (nq > nd) { + return false; + } + if (nq === nd) { + return equiv(query, domain); + } + next: + for (let i = 0, j = 0; i < nq; i++) { + const q = query[i]; + while (j < nd) { + if (equiv(domain[j++], q)) { + continue next; + } + } + return false; + } + return true; +}; diff --git a/packages/arrays/src/index.ts b/packages/arrays/src/index.ts new file mode 100644 index 0000000000..b1edbe0ed5 --- /dev/null +++ b/packages/arrays/src/index.ts @@ -0,0 +1,9 @@ +export * from "./binary-search"; +export * from "./ends-with"; +export * from "./ensure-array"; +export * from "./ensure-iterable"; +export * from "./fuzzy-match"; +export * from "./peek"; +export * from "./shuffle"; +export * from "./starts-with"; +export * from "./swizzle"; diff --git a/packages/arrays/src/peek.ts b/packages/arrays/src/peek.ts new file mode 100644 index 0000000000..05376f68d2 --- /dev/null +++ b/packages/arrays/src/peek.ts @@ -0,0 +1,7 @@ +/** + * Returns last element of given array or `undefined` if array is empty. + * + * @param x + */ +export const peek = + (x: ArrayLike) => x[x.length - 1]; diff --git a/packages/arrays/src/shuffle.ts b/packages/arrays/src/shuffle.ts new file mode 100644 index 0000000000..8e96af68cd --- /dev/null +++ b/packages/arrays/src/shuffle.ts @@ -0,0 +1,17 @@ +import { IRandom, SYSTEM } from "@thi.ng/random"; + +export const shuffle = + (buf: any[], n = buf.length, rnd: IRandom = SYSTEM) => { + const l = buf.length; + if (l > 1) { + n = Math.min(n, l); + while (--n >= 0) { + const a = rnd.float(l) | 0; + const b = rnd.float(l) | 0; + const t = buf[a]; + buf[a] = buf[b]; + buf[b] = t; + } + } + return buf; + }; diff --git a/packages/arrays/src/starts-with.ts b/packages/arrays/src/starts-with.ts new file mode 100644 index 0000000000..589f8192de --- /dev/null +++ b/packages/arrays/src/starts-with.ts @@ -0,0 +1,10 @@ +import { equiv as _eq } from "@thi.ng/equiv"; + +export const startsWith = + (buf: ArrayLike, needle: ArrayLike, equiv = _eq) => { + let i = buf.length; + let j = needle.length; + if (i < j) return false; + while (-j >= 0 && equiv(buf[j], needle[j])) { } + return j < 0; + }; diff --git a/packages/arrays/src/swizzle.ts b/packages/arrays/src/swizzle.ts new file mode 100644 index 0000000000..4c51c97cdf --- /dev/null +++ b/packages/arrays/src/swizzle.ts @@ -0,0 +1,55 @@ +import { Fn } from "@thi.ng/api"; + +/** + * Returns optimized function to immutably select, repeat, reshape and / + * or reorder array / object values in the specified index order. Fast + * paths for up to 8 indices are provided, before a loop based approach + * is used. + * + * ``` + * swizzle([0, 0, 0])([1, 2, 3, 4]) // [ 1, 1, 1 ] + * swizzle([1, 1, 3, 3])([1, 2, 3, 4]) // [ 2, 2, 4, 4 ] + * swizzle([2, 0])([1, 2, 3]) // [ 3, 1 ] + * ``` + * + * Objects can be used as input to the generated function, but the + * result will always be in array form. + * + * ``` + * swizzle(["a", "c", "b"])({a: 1, b: 2, c: 3}) // [ 1, 3, 2 ] + * ``` + * + * @param order indices + */ +export const swizzle = + (order: string | PropertyKey[]): Fn => { + const [a, b, c, d, e, f, g, h] = order; + switch (order.length) { + case 0: + return () => []; + case 1: + return (x) => [x[a]]; + case 2: + return (x) => [x[a], x[b]]; + case 3: + return (x) => [x[a], x[b], x[c]]; + case 4: + return (x) => [x[a], x[b], x[c], x[d]]; + case 5: + return (x) => [x[a], x[b], x[c], x[d], x[e]]; + case 6: + return (x) => [x[a], x[b], x[c], x[d], x[e], x[f]]; + case 7: + return (x) => [x[a], x[b], x[c], x[d], x[e], x[f], x[g]]; + case 8: + return (x) => [x[a], x[b], x[c], x[d], x[e], x[f], x[g], x[h]]; + default: + return (x) => { + const res = []; + for (let i = order.length; --i >= 0;) { + res[i] = x[order[i]]; + } + return res; + }; + } + }; diff --git a/packages/arrays/test/index.ts b/packages/arrays/test/index.ts new file mode 100644 index 0000000000..e74dbb435e --- /dev/null +++ b/packages/arrays/test/index.ts @@ -0,0 +1,6 @@ +// import * as assert from "assert"; +// import * as a from "../src/index"; + +describe("arrays", () => { + it("tests pending"); +}); diff --git a/packages/arrays/test/tsconfig.json b/packages/arrays/test/tsconfig.json new file mode 100644 index 0000000000..f6e63560dd --- /dev/null +++ b/packages/arrays/test/tsconfig.json @@ -0,0 +1,11 @@ +{ + "extends": "../../../tsconfig.json", + "compilerOptions": { + "outDir": "../build", + "module": "commonjs" + }, + "include": [ + "./**/*.ts", + "../src/**/*.ts" + ] +} diff --git a/packages/arrays/tsconfig.json b/packages/arrays/tsconfig.json new file mode 100644 index 0000000000..893b9979c5 --- /dev/null +++ b/packages/arrays/tsconfig.json @@ -0,0 +1,11 @@ +{ + "extends": "../../tsconfig.json", + "compilerOptions": { + "outDir": ".", + "module": "es6", + "target": "es6" + }, + "include": [ + "./src/**/*.ts" + ] +} From 83cb816ad6857927a4f10a3b543ca4d1c1bc5244 Mon Sep 17 00:00:00 2001 From: Karsten Schmidt Date: Tue, 12 Feb 2019 14:50:54 +0000 Subject: [PATCH 08/33] refactor(transducers): remove obsolete fns, update to use @thi.ng/arrays BREAKING CHANGE: migrate various support fns to @thi.ng/arrays - remove/migrate functions: - binarySearch() - ensureArray() / ensureIterable() - fuzzyMatch() - peek() - shuffleN() - swizzler() - add support for IRandom in: - randomID() - choices() - weightedRandom() - sample() - update deps / readme --- packages/transducers/README.md | 35 ++++++++---- packages/transducers/package.json | 12 ++++- .../transducers/src/func/binary-search.ts | 36 ------------- packages/transducers/src/func/ensure-array.ts | 18 ------- .../transducers/src/func/ensure-iterable.ts | 9 ---- packages/transducers/src/func/fuzzy-match.ts | 42 --------------- packages/transducers/src/func/peek.ts | 7 --- packages/transducers/src/func/random-id.ts | 6 ++- packages/transducers/src/func/shuffle.ts | 12 ----- packages/transducers/src/func/swizzler.ts | 54 ------------------- .../transducers/src/func/weighted-random.ts | 13 +++-- packages/transducers/src/index.ts | 6 --- packages/transducers/src/iter/choices.ts | 12 +++-- packages/transducers/src/iter/concat.ts | 2 +- packages/transducers/src/iter/permutations.ts | 2 +- packages/transducers/src/iter/reverse.ts | 2 +- packages/transducers/src/iter/wrap.ts | 2 +- .../transducers/src/xform/filter-fuzzy.ts | 4 +- packages/transducers/src/xform/sample.ts | 25 +++++---- .../transducers/src/xform/stream-shuffle.ts | 6 +-- packages/transducers/src/xform/stream-sort.ts | 7 ++- packages/transducers/src/xform/swizzle.ts | 8 +-- packages/transducers/test/permutations.ts | 2 +- 23 files changed, 88 insertions(+), 234 deletions(-) delete mode 100644 packages/transducers/src/func/binary-search.ts delete mode 100644 packages/transducers/src/func/ensure-array.ts delete mode 100644 packages/transducers/src/func/ensure-iterable.ts delete mode 100644 packages/transducers/src/func/fuzzy-match.ts delete mode 100644 packages/transducers/src/func/peek.ts delete mode 100644 packages/transducers/src/func/shuffle.ts delete mode 100644 packages/transducers/src/func/swizzler.ts diff --git a/packages/transducers/README.md b/packages/transducers/README.md index d686b3a97a..190446be2b 100644 --- a/packages/transducers/README.md +++ b/packages/transducers/README.md @@ -10,6 +10,7 @@ This project is part of the - [About](#about) + - [5.0.0 release](#500-release) - [Related packages](#related-packages) - [Installation](#installation) - [Dependencies](#dependencies) @@ -32,7 +33,7 @@ This project is part of the - [Types](#types) - [IReducible](#ireducible) - [Transducer](#transducer) - - [Transformations](#transformations) + - [Composition & execution](#composition--execution) - [Transducers](#transducers) - [Generators / Iterators](#generators--iterators) - [Reducers](#reducers) @@ -43,7 +44,7 @@ This project is part of the ## About -This library provides altogether 130+ transducers, reducers, sequence +This library provides altogether ~120 transducers, reducers, sequence generators (iterators) and other supporting functions for composing data transformation pipelines. @@ -53,13 +54,27 @@ though the implementation does heavily differ (also in contrast to some other JS based implementations) and dozens of less common, but generally highly useful operators have been added. See full list below. -Furthermore, since v2.0.0 most transducers & reducers provided here -accept an optional input iterable, which allows them to be used -directly instead of having to wrap their call in one of the execution -functions (i.e. `transduce()`, `reduce()`, `iterator()`, `run()`). If -executed this way, transducer functions will return a transforming ES6 -iterator (generator) and reducing functions will return a reduced result -of the given input iterable. +Furthermore, most transducers & reducers provided here accept an +optional input iterable, which allows them to be used directly instead +of having to wrap their call in one of the execution functions (i.e. +`transduce()`, `reduce()`, `iterator()`, `run()`). If executed this way, +transducer functions will return a transforming ES6 iterator (generator) +and reducing functions will return a reduced result of the given input +iterable. + +### 5.0.0 release + +Several previously included internal support functions have been +migrated to the +[@thi.ng/arrays](https://github.com/thi-ng/umbrella/tree/master/packages/arrays) +package. You'll need to update your imports if you've been using any of +these directly. Note that some of these functions also have changes to +their arg order. + +Functions using randomness now all support an optional PRNG +implementation of the `IRandom` interface from the +[@thi.ng/random](https://github.com/thi-ng/umbrella/tree/master/packages/random) +package. ### Related packages @@ -574,7 +589,7 @@ function dedupe(): Transducer { } ``` -### Transformations +### Composition & execution #### `comp(f1, f2, ...)` diff --git a/packages/transducers/package.json b/packages/transducers/package.json index 1293f85add..f9e0cf8412 100644 --- a/packages/transducers/package.json +++ b/packages/transducers/package.json @@ -33,23 +33,33 @@ }, "dependencies": { "@thi.ng/api": "^5.0.2", + "@thi.ng/arrays": "^0.0.1", "@thi.ng/checks": "^2.1.0", "@thi.ng/compare": "^1.0.2", "@thi.ng/compose": "^1.0.2", "@thi.ng/equiv": "^1.0.2", "@thi.ng/errors": "^1.0.2", + "@thi.ng/random": "^1.0.2", "@thi.ng/strings": "^1.0.3" }, "keywords": [ "array", "composition", "data", + "dedupe", "ES6", + "flatten", "functional", "generators", + "iterables", "iterators", + "interleave", + "paging", + "partition", "pipeline", "reducers", + "stepwise", + "stream", "transducers", "transformation", "typescript" @@ -58,4 +68,4 @@ "access": "public" }, "sideEffects": false -} +} \ No newline at end of file diff --git a/packages/transducers/src/func/binary-search.ts b/packages/transducers/src/func/binary-search.ts deleted file mode 100644 index 1e0086b713..0000000000 --- a/packages/transducers/src/func/binary-search.ts +++ /dev/null @@ -1,36 +0,0 @@ -import { Comparator, Fn } from "@thi.ng/api"; - -/** - * Returns the supposed index of `x` in pre-sorted array-like collection - * `arr`. The `key` function first is used to obtain the actual sort - * value of `x` and each array item. The `cmp` comparator is then used to - * identify the index of `x`. - * - * @param arr - * @param key - * @param cmp - * @param x - * @returns index of `x`, else `-index` if item could not be found - */ -export const binarySearch = ( - arr: ArrayLike, - key: Fn, - cmp: Comparator, - x: A -) => { - const kx = key(x); - let low = 0; - let high = arr.length - 1; - while (low <= high) { - const mid = (low + high) >>> 1; - const c = cmp(key(arr[mid]), kx); - if (c < 0) { - low = mid + 1; - } else if (c > 0) { - high = mid - 1; - } else { - return mid; - } - } - return -low; -}; diff --git a/packages/transducers/src/func/ensure-array.ts b/packages/transducers/src/func/ensure-array.ts deleted file mode 100644 index 0de070f414..0000000000 --- a/packages/transducers/src/func/ensure-array.ts +++ /dev/null @@ -1,18 +0,0 @@ -import { isArray, isArrayLike } from "@thi.ng/checks"; -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 const ensureArray = - (x: any): any[] => - isArray(x) ? x : [...ensureIterable(x)]; - -export const ensureArrayLike = - (x: any): ArrayLike => - isArrayLike(x) ? x : [...ensureIterable(x)]; diff --git a/packages/transducers/src/func/ensure-iterable.ts b/packages/transducers/src/func/ensure-iterable.ts deleted file mode 100644 index dd9acf06c5..0000000000 --- a/packages/transducers/src/func/ensure-iterable.ts +++ /dev/null @@ -1,9 +0,0 @@ -import { illegalArgs } from "@thi.ng/errors"; - -export const ensureIterable = - (x: any): IterableIterator => { - if (!(x != null && x[Symbol.iterator])) { - illegalArgs(`value is not iterable: ${x}`); - } - return x; - }; diff --git a/packages/transducers/src/func/fuzzy-match.ts b/packages/transducers/src/func/fuzzy-match.ts deleted file mode 100644 index d9476ff966..0000000000 --- a/packages/transducers/src/func/fuzzy-match.ts +++ /dev/null @@ -1,42 +0,0 @@ -import { Predicate2 } from "@thi.ng/api"; -import { equiv } from "@thi.ng/equiv"; - -/** - * Performs a fuzzy search of `query` in `domain` and returns `true` if - * successful. The optional `eq` predicate can be used to customize item - * equality checking. Uses @thi.ng/equiv by default. - * - * Related transducer: `filterFuzzy()` (/xform/filter-fuzzy.ts) - * - * Adapted and generalized from: - * https://github.com/bevacqua/fufuzzyzzysearch (MIT) - * - * @param domain - * @param query - * @param eq - */ -export const fuzzyMatch = ( - domain: ArrayLike, - query: ArrayLike, - eq: Predicate2 = equiv -) => { - const nd = domain.length; - const nq = query.length; - if (nq > nd) { - return false; - } - if (nq === nd) { - return eq(query, domain); - } - next: - for (let i = 0, j = 0; i < nq; i++) { - const q = query[i]; - while (j < nd) { - if (eq(domain[j++], q)) { - continue next; - } - } - return false; - } - return true; -}; diff --git a/packages/transducers/src/func/peek.ts b/packages/transducers/src/func/peek.ts deleted file mode 100644 index f0c29728fe..0000000000 --- a/packages/transducers/src/func/peek.ts +++ /dev/null @@ -1,7 +0,0 @@ -/** - * Returns last element of given array. - * - * @param x - */ -export const peek = - (x: ArrayLike) => x[x.length - 1]; diff --git a/packages/transducers/src/func/random-id.ts b/packages/transducers/src/func/random-id.ts index f4901cbb38..5979d8aed5 100644 --- a/packages/transducers/src/func/random-id.ts +++ b/packages/transducers/src/func/random-id.ts @@ -1,3 +1,4 @@ +import { IRandom, SYSTEM } from "@thi.ng/random"; import { choices } from "../iter/choices"; import { take } from "../xform/take"; @@ -17,7 +18,8 @@ import { take } from "../xform/take"; * @param len * @param prefix * @param syms + * @param rnd */ export const randomID = - (len = 4, prefix = "", syms = "abcdefghijklmnopqrstuvwxyz") => - [prefix, ...take(len, choices(syms))].join(""); + (len = 4, prefix = "", syms = "abcdefghijklmnopqrstuvwxyz", rnd: IRandom = SYSTEM) => + [prefix, ...take(len, choices(syms, null, rnd))].join(""); diff --git a/packages/transducers/src/func/shuffle.ts b/packages/transducers/src/func/shuffle.ts deleted file mode 100644 index 9a3b355215..0000000000 --- a/packages/transducers/src/func/shuffle.ts +++ /dev/null @@ -1,12 +0,0 @@ -export const shuffleN = - (buf: any[], n: number) => { - const l = buf.length; - n = n < l ? n : l; - while (--n >= 0) { - const a = (Math.random() * l) | 0; - const b = (Math.random() * l) | 0; - const t = buf[a]; - buf[a] = buf[b]; - buf[b] = t; - } - }; diff --git a/packages/transducers/src/func/swizzler.ts b/packages/transducers/src/func/swizzler.ts deleted file mode 100644 index 5c368006eb..0000000000 --- a/packages/transducers/src/func/swizzler.ts +++ /dev/null @@ -1,54 +0,0 @@ -/** - * Returns optimized function to select, repeat, reshape and / or - * reorder array/object values in the specified index order. The - * returned function can be used directly or as mapping function for the - * `map` transducer. Fast paths for up to 8 indices are provided, before - * a loop based approach is used. - * - * ``` - * swizzler([0, 0, 0])([1, 2, 3, 4]) // [ 1, 1, 1 ] - * swizzler([1, 1, 3, 3])([1, 2, 3, 4]) // [ 2, 2, 4, 4 ] - * swizzler([2, 0])([1, 2, 3]) // [ 3, 1 ] - * ``` - * - * Even though, objects can be used as input to the generated function, - * the returned values will always be in array form. - * - * ``` - * swizzler(["a", "c", "b"])({a: 1, b: 2, c: 3}) // [ 1, 3, 2 ] - * ``` - * - * @param order indices - */ -export const swizzler = - (order: string | PropertyKey[]): (x: T) => any[] => { - const [a, b, c, d, e, f, g, h] = order; - switch (order.length) { - case 0: - return () => []; - case 1: - return (x) => [x[a]]; - case 2: - return (x) => [x[a], x[b]]; - case 3: - return (x) => [x[a], x[b], x[c]]; - case 4: - return (x) => [x[a], x[b], x[c], x[d]]; - case 5: - return (x) => [x[a], x[b], x[c], x[d], x[e]]; - case 6: - return (x) => [x[a], x[b], x[c], x[d], x[e], x[f]]; - case 7: - return (x) => [x[a], x[b], x[c], x[d], x[e], x[f], x[g]]; - case 8: - return (x) => [x[a], x[b], x[c], x[d], x[e], x[f], x[g], x[h]]; - default: - return (x) => { - const res = []; - for (let i = order.length - 1; i >= 0; i--) { - res[i] = x[order[i]]; - } - return res; - }; - } - }; diff --git a/packages/transducers/src/func/weighted-random.ts b/packages/transducers/src/func/weighted-random.ts index 290a15f564..52c26deb4d 100644 --- a/packages/transducers/src/func/weighted-random.ts +++ b/packages/transducers/src/func/weighted-random.ts @@ -1,9 +1,11 @@ +import { IRandom, SYSTEM } from "@thi.ng/random"; import { repeat } from "../iter/repeat"; import { zip } from "../iter/zip"; /** - * If `weights` are given, it must be the same size as `choices`. If omitted, - * each choice will have same probability. + * Returns a no-arg function which produces a random choice of given + * weighted `choices`. If `weights` are given, it must be the same size + * as `choices`. If omitted, each choice will have same probability. * * https://www.electricmonk.nl/log/2009/12/23/weighted-random-distribution/ * @@ -12,16 +14,17 @@ import { zip } from "../iter/zip"; */ export const weightedRandom = ( choices: ArrayLike & Iterable, - weights?: ArrayLike & Iterable + weights?: ArrayLike & Iterable, + rnd: IRandom = SYSTEM ) => { const n = choices.length; const opts = [...zip(choices, weights || repeat(1))].sort((a, b) => b[1] - a[1]); let total = 0, i, r, sum; for (i = 0; i < n; i++) { - total += weights[i]; + total += opts[i][1]; } return () => { - r = Math.random() * total; + r = rnd.float(total); sum = total; for (i = 0; i < n; i++) { sum -= opts[i][1]; diff --git a/packages/transducers/src/index.ts b/packages/transducers/src/index.ts index 8410a549bc..03f409a86c 100644 --- a/packages/transducers/src/index.ts +++ b/packages/transducers/src/index.ts @@ -92,16 +92,12 @@ export * from "./xform/throttle-time"; export * from "./xform/trace"; export * from "./xform/word-wrap"; -export * from "./func/binary-search"; export * from "./func/comp"; 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"; export * from "./func/hex"; export * from "./func/identity"; export * from "./func/juxt"; @@ -109,10 +105,8 @@ export * from "./func/juxtr"; export * from "./func/key-selector"; export * from "./func/lookup"; export * from "./func/odd"; -export * from "./func/peek"; export * from "./func/random-id"; export * from "./func/renamer"; -export * from "./func/swizzler"; export * from "./func/weighted-random"; export * from "./iter/as-iterable"; diff --git a/packages/transducers/src/iter/choices.ts b/packages/transducers/src/iter/choices.ts index 8abd5b830a..73858bdc26 100644 --- a/packages/transducers/src/iter/choices.ts +++ b/packages/transducers/src/iter/choices.ts @@ -1,27 +1,29 @@ import { weightedRandom } from "../func/weighted-random"; import { repeatedly } from "./repeatedly"; +import { IRandom, SYSTEM } from "@thi.ng/random"; /** * Returns an infinite iterator of random choices and their (optional) * weights. If `weights` is given, it must have at least the same size * as `choices`. If omitted, each choice will have same probability. * - * See: `weightedRandom()` - * * ``` * transduce(take(1000), frequencies(), choices("abcd", [1, 0.5, 0.25, 0.125])) * // Map { 'c' => 132, 'a' => 545, 'b' => 251, 'd' => 72 } * ``` * + * @see weightedRandom + * * @param choices * @param weights */ export const choices = ( choices: ArrayLike & Iterable, - weights?: ArrayLike & Iterable + weights?: ArrayLike & Iterable, + rnd: IRandom = SYSTEM ) => repeatedly( weights ? - weightedRandom(choices, weights) : - () => choices[(Math.random() * choices.length) | 0] + weightedRandom(choices, weights, rnd) : + () => choices[(rnd.float(choices.length) | 0)] ); diff --git a/packages/transducers/src/iter/concat.ts b/packages/transducers/src/iter/concat.ts index f03550abd5..a4f89396aa 100644 --- a/packages/transducers/src/iter/concat.ts +++ b/packages/transducers/src/iter/concat.ts @@ -1,4 +1,4 @@ -import { ensureIterable } from "../func/ensure-iterable"; +import { ensureIterable } from "@thi.ng/arrays"; /** * Yields iterator producing concatenation of given iterables. diff --git a/packages/transducers/src/iter/permutations.ts b/packages/transducers/src/iter/permutations.ts index 67c7fd2c50..abe70d1df6 100644 --- a/packages/transducers/src/iter/permutations.ts +++ b/packages/transducers/src/iter/permutations.ts @@ -1,5 +1,5 @@ +import { ensureArrayLike } from "@thi.ng/arrays"; import { illegalArgs } from "@thi.ng/errors"; -import { ensureArrayLike } from "../func/ensure-array"; import { range } from "./range"; /** diff --git a/packages/transducers/src/iter/reverse.ts b/packages/transducers/src/iter/reverse.ts index 332b18ddac..e889121d6f 100644 --- a/packages/transducers/src/iter/reverse.ts +++ b/packages/transducers/src/iter/reverse.ts @@ -1,4 +1,4 @@ -import { ensureArray } from "../func/ensure-array"; +import { ensureArray } from "@thi.ng/arrays"; /** * Yields iterator which consumes input and yield its values in reverse diff --git a/packages/transducers/src/iter/wrap.ts b/packages/transducers/src/iter/wrap.ts index 100e857528..79ff2e0269 100644 --- a/packages/transducers/src/iter/wrap.ts +++ b/packages/transducers/src/iter/wrap.ts @@ -1,5 +1,5 @@ +import { ensureArray } from "@thi.ng/arrays"; import { illegalArgs } from "@thi.ng/errors"; -import { ensureArray } from "../func/ensure-array"; /** * Yields iterator of `src` with the last `n` values of `src` prepended diff --git a/packages/transducers/src/xform/filter-fuzzy.ts b/packages/transducers/src/xform/filter-fuzzy.ts index 2a73761f18..3f68bebf5b 100644 --- a/packages/transducers/src/xform/filter-fuzzy.ts +++ b/packages/transducers/src/xform/filter-fuzzy.ts @@ -1,6 +1,6 @@ import { Fn, Predicate2 } from "@thi.ng/api"; +import { fuzzyMatch } from "@thi.ng/arrays"; import { Transducer } from "../api"; -import { fuzzyMatch } from "../func/fuzzy-match"; import { $iter } from "../iterator"; import { filter } from "./filter"; @@ -35,6 +35,6 @@ export function filterFuzzy(...args: any[]): any { const query: ArrayLike = args[0]; const { key, equiv } = >(args[1] || {}); return filter( - (x: A) => fuzzyMatch(key != null ? key(x) : x, query, equiv) + (x: A) => fuzzyMatch(query, key != null ? key(x) : x, equiv) ); } diff --git a/packages/transducers/src/xform/sample.ts b/packages/transducers/src/xform/sample.ts index 51e3af2bdf..df487474cd 100644 --- a/packages/transducers/src/xform/sample.ts +++ b/packages/transducers/src/xform/sample.ts @@ -1,6 +1,7 @@ +import { IRandom, SYSTEM } from "@thi.ng/random"; import { Reducer, Transducer } from "../api"; import { compR } from "../func/compr"; -import { iterator1 } from "../iterator"; +import { $iter } from "../iterator"; /** * Transducer which only yields values with given `prob` probability @@ -16,13 +17,19 @@ import { iterator1 } from "../iterator"; * @param src */ export function sample(prob: number): Transducer; +export function sample(prob: number, rnd: IRandom): Transducer; export function sample(prob: number, src: Iterable): IterableIterator; -export function sample(prob: number, src?: Iterable): any { - return src ? - iterator1(sample(prob), src) : - (rfn: Reducer) => { - const r = rfn[2]; - return compR(rfn, - (acc, x: T) => Math.random() < prob ? r(acc, x) : acc); - } +export function sample(prob: number, rnd: IRandom, src: Iterable): IterableIterator; +export function sample(...args: any[]): any { + const iter = $iter(sample, args); + if (iter) { + return iter; + } + const prob = args[0]; + const rnd: IRandom = args[1] || SYSTEM; + return (rfn: Reducer) => { + const r = rfn[2]; + return compR(rfn, + (acc, x: T) => rnd.float() < prob ? r(acc, x) : acc); + }; } diff --git a/packages/transducers/src/xform/stream-shuffle.ts b/packages/transducers/src/xform/stream-shuffle.ts index b0472d45f3..686efa7e28 100644 --- a/packages/transducers/src/xform/stream-shuffle.ts +++ b/packages/transducers/src/xform/stream-shuffle.ts @@ -1,5 +1,5 @@ +import { shuffle } from "@thi.ng/arrays"; import { Reducer, Transducer } from "../api"; -import { shuffleN } from "../func/shuffle"; import { $iter, iterator } from "../iterator"; import { isReduced } from "../reduced"; @@ -30,7 +30,7 @@ export function streamShuffle(...args: any[]): any { init, (acc) => { while (buf.length && !isReduced(acc)) { - shuffleN(buf, maxSwaps); + shuffle(buf, maxSwaps); acc = reduce(acc, buf.shift()); } acc = complete(acc); @@ -38,7 +38,7 @@ export function streamShuffle(...args: any[]): any { }, (acc, x: T) => { buf.push(x); - shuffleN(buf, maxSwaps); + shuffle(buf, maxSwaps); if (buf.length === n) { acc = reduce(acc, buf.shift()); } diff --git a/packages/transducers/src/xform/stream-sort.ts b/packages/transducers/src/xform/stream-sort.ts index 935fd79ed3..2b54136657 100644 --- a/packages/transducers/src/xform/stream-sort.ts +++ b/packages/transducers/src/xform/stream-sort.ts @@ -1,7 +1,6 @@ +import { binarySearch } from "@thi.ng/arrays"; import { compare as cmp } from "@thi.ng/compare"; - import { Reducer, SortOpts, Transducer } from "../api"; -import { binarySearch } from "../func/binary-search"; import { identity } from "../func/identity"; import { $iter, iterator } from "../iterator"; import { isReduced } from "../reduced"; @@ -45,8 +44,8 @@ export function streamSort(...args: any[]): any { return complete(acc); }, (acc, x) => { - const idx = binarySearch(buf, key, compare, x); - buf.splice(Math.abs(idx), 0, x); + const idx = binarySearch(x, buf, key, compare); + buf.splice(idx < 0 ? -(idx + 1) : idx, 0, x); if (buf.length === n) { acc = reduce(acc, buf.shift()); } diff --git a/packages/transducers/src/xform/swizzle.ts b/packages/transducers/src/xform/swizzle.ts index 62e5128e3f..698002bbb5 100644 --- a/packages/transducers/src/xform/swizzle.ts +++ b/packages/transducers/src/xform/swizzle.ts @@ -1,5 +1,5 @@ +import { swizzle as _swizzle } from "@thi.ng/arrays"; import { Transducer } from "../api"; -import { swizzler } from "../func/swizzler"; import { iterator1 } from "../iterator"; import { map } from "./map"; @@ -8,8 +8,6 @@ import { map } from "./map"; * property order. Accepts arrays or objects as input, but always yields * arrays. * - * Also see `swizzler()` for standalone (non-transducer) usage. - * * ``` * [...swizzle([3,0,2,1], [[1,2,3,4], [10,20,30,40]])] * // [ [ 4, 1, 3, 2 ], [ 40, 10, 30, 20 ] ] @@ -21,6 +19,8 @@ import { map } from "./map"; * // [ [ 3, 1 ] ] * ``` * + * @see thi.ng/arrays/swizzle + * * @param order key order */ export function swizzle(order: PropertyKey[]): Transducer; @@ -28,5 +28,5 @@ export function swizzle(order: PropertyKey[], src: Iterable): IterableIt export function swizzle(order: PropertyKey[], src?: Iterable): any { return src ? iterator1(swizzle(order), src) : - map(swizzler(order)); + map(_swizzle(order)); } diff --git a/packages/transducers/test/permutations.ts b/packages/transducers/test/permutations.ts index ccb6a233e3..ad3ce8a60a 100644 --- a/packages/transducers/test/permutations.ts +++ b/packages/transducers/test/permutations.ts @@ -1,4 +1,4 @@ -import { swizzler } from "../src/func/swizzler"; +import { swizzler } from "@thi.ng/arrays"; import { permutations, permutationsN } from "../src/iter/permutations"; import { range } from "../src/iter/range"; import { iterator } from "../src/iterator"; From 83260ed64e1e437d124b71667211ba343a7df496 Mon Sep 17 00:00:00 2001 From: Karsten Schmidt Date: Tue, 12 Feb 2019 14:51:43 +0000 Subject: [PATCH 09/33] refactor(bencode): update to use @thi.ng/arrays --- packages/bencode/package.json | 1 + packages/bencode/src/index.ts | 3 ++- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/packages/bencode/package.json b/packages/bencode/package.json index 5ba528123b..f96bdf580b 100644 --- a/packages/bencode/package.json +++ b/packages/bencode/package.json @@ -33,6 +33,7 @@ }, "dependencies": { "@thi.ng/api": "^5.0.2", + "@thi.ng/arrays": "^0.0.1", "@thi.ng/checks": "^2.1.0", "@thi.ng/defmulti": "^1.0.2", "@thi.ng/errors": "^1.0.2", diff --git a/packages/bencode/src/index.ts b/packages/bencode/src/index.ts index aa2b5c8b45..6ef0879f35 100644 --- a/packages/bencode/src/index.ts +++ b/packages/bencode/src/index.ts @@ -1,4 +1,5 @@ import { assert } from "@thi.ng/api"; +import { peek } from "@thi.ng/arrays"; import { isArray, isArrayLike, @@ -9,7 +10,7 @@ import { } from "@thi.ng/checks"; import { defmulti } from "@thi.ng/defmulti"; import { illegalState } from "@thi.ng/errors"; -import { mapcat, peek } from "@thi.ng/transducers"; +import { mapcat } from "@thi.ng/transducers"; import { BinStructItem, bytes, From 64204a11dba6d554a242f97e3744077ce6b90bda Mon Sep 17 00:00:00 2001 From: Karsten Schmidt Date: Tue, 12 Feb 2019 14:52:48 +0000 Subject: [PATCH 10/33] refactor(csp): use @thi.ng/arrays, remove obsolete shuffle() --- packages/csp/package.json | 3 ++- packages/csp/src/channel.ts | 2 +- packages/csp/src/utils/shuffle.ts | 14 -------------- 3 files changed, 3 insertions(+), 16 deletions(-) delete mode 100644 packages/csp/src/utils/shuffle.ts diff --git a/packages/csp/package.json b/packages/csp/package.json index 8b4df24493..cd1df60f81 100644 --- a/packages/csp/package.json +++ b/packages/csp/package.json @@ -37,6 +37,7 @@ }, "dependencies": { "@thi.ng/api": "^5.0.2", + "@thi.ng/arrays": "^0.0.1", "@thi.ng/checks": "^2.1.0", "@thi.ng/dcons": "^2.0.4", "@thi.ng/errors": "^1.0.2", @@ -59,4 +60,4 @@ "access": "public" }, "sideEffects": false -} +} \ No newline at end of file diff --git a/packages/csp/src/channel.ts b/packages/csp/src/channel.ts index 1b82f0f929..ac161f80eb 100644 --- a/packages/csp/src/channel.ts +++ b/packages/csp/src/channel.ts @@ -1,4 +1,5 @@ import { Predicate } from "@thi.ng/api"; +import { shuffle } from "@thi.ng/arrays"; import { isFunction } from "@thi.ng/checks"; import { DCons } from "@thi.ng/dcons"; import { illegalArity } from "@thi.ng/errors"; @@ -19,7 +20,6 @@ import { State } from "./api"; import { FixedBuffer } from "./buffer"; -import { shuffle } from "./utils/shuffle"; export class Channel implements IReadWriteableChannel { diff --git a/packages/csp/src/utils/shuffle.ts b/packages/csp/src/utils/shuffle.ts deleted file mode 100644 index 14ff0f63fd..0000000000 --- a/packages/csp/src/utils/shuffle.ts +++ /dev/null @@ -1,14 +0,0 @@ -export const shuffle = - (items: T[]) => { - let n = items.length; - if (n > 1) { - while (n > 0) { - const i = (Math.random() * n) | 0; - n--; - const t = items[i]; - items[i] = items[n]; - items[n] = t; - } - } - return items; - }; From 3abdc9ebad544162d418b9abd043a3e5b93368c3 Mon Sep 17 00:00:00 2001 From: Karsten Schmidt Date: Tue, 12 Feb 2019 14:53:17 +0000 Subject: [PATCH 11/33] refactor(fsm): update to use @thi.ng/arrays --- packages/fsm/package.json | 3 ++- packages/fsm/src/until.ts | 14 +------------- 2 files changed, 3 insertions(+), 14 deletions(-) diff --git a/packages/fsm/package.json b/packages/fsm/package.json index acb305fed1..158751e3d4 100644 --- a/packages/fsm/package.json +++ b/packages/fsm/package.json @@ -33,6 +33,7 @@ }, "dependencies": { "@thi.ng/api": "^5.0.2", + "@thi.ng/arrays": "^0.0.1", "@thi.ng/equiv": "^1.0.2", "@thi.ng/errors": "^1.0.2", "@thi.ng/transducers": "^4.0.1" @@ -55,4 +56,4 @@ "access": "public" }, "sideEffects": false -} +} \ No newline at end of file diff --git a/packages/fsm/src/until.ts b/packages/fsm/src/until.ts index 399bac6f25..5316448de6 100644 --- a/packages/fsm/src/until.ts +++ b/packages/fsm/src/until.ts @@ -1,3 +1,4 @@ +import { endsWith } from "@thi.ng/arrays"; import { LitCallback, Matcher, RES_PARTIAL } from "./api"; import { result } from "./result"; @@ -47,16 +48,3 @@ export const until = ( RES_PARTIAL; }; }; - -const endsWith = - (src: any[], needle: any[]) => { - let i = src.length; - let j = needle.length; - if (i < j) return false; - for (; --i, --j >= 0;) { - if (src[i] !== needle[j]) { - return false; - } - } - return true; - }; From 78095f4f51f1d11f71a400ee3da9ff249af7ba51 Mon Sep 17 00:00:00 2001 From: Karsten Schmidt Date: Tue, 12 Feb 2019 14:54:16 +0000 Subject: [PATCH 12/33] refactor(geom): update to use @thi.ng/arrays --- packages/geom/package.json | 3 ++- packages/geom/src/ctors/path.ts | 3 ++- packages/geom/src/internal/args.ts | 2 +- packages/geom/src/ops/simplify.ts | 2 +- 4 files changed, 6 insertions(+), 4 deletions(-) diff --git a/packages/geom/package.json b/packages/geom/package.json index a8aed2ee31..c14a5f233e 100644 --- a/packages/geom/package.json +++ b/packages/geom/package.json @@ -33,6 +33,7 @@ }, "dependencies": { "@thi.ng/api": "^5.0.2", + "@thi.ng/arrays": "^0.0.1", "@thi.ng/checks": "^2.1.0", "@thi.ng/compose": "^1.0.2", "@thi.ng/defmulti": "^1.0.2", @@ -71,4 +72,4 @@ "access": "public" }, "sideEffects": false -} +} \ No newline at end of file diff --git a/packages/geom/src/ctors/path.ts b/packages/geom/src/ctors/path.ts index b94f7b8fcd..0caf648e0d 100644 --- a/packages/geom/src/ctors/path.ts +++ b/packages/geom/src/ctors/path.ts @@ -1,7 +1,8 @@ +import { peek } from "@thi.ng/arrays"; import { isNumber } from "@thi.ng/checks"; import { Attribs, PathSegment, SegmentType } from "@thi.ng/geom-api"; import { eqDelta, rad } from "@thi.ng/math"; -import { map, mapcat, peek } from "@thi.ng/transducers"; +import { map, mapcat } from "@thi.ng/transducers"; import { add2, copy, diff --git a/packages/geom/src/internal/args.ts b/packages/geom/src/internal/args.ts index 7bf1bba99f..451a1908b5 100644 --- a/packages/geom/src/internal/args.ts +++ b/packages/geom/src/internal/args.ts @@ -1,5 +1,5 @@ +import { peek } from "@thi.ng/arrays"; import { isNumber, isPlainObject } from "@thi.ng/checks"; -import { peek } from "@thi.ng/transducers"; /** * Takes an array of arguments, checks if last element is a plain object diff --git a/packages/geom/src/ops/simplify.ts b/packages/geom/src/ops/simplify.ts index 8cb229d8c2..164aeaf9a9 100644 --- a/packages/geom/src/ops/simplify.ts +++ b/packages/geom/src/ops/simplify.ts @@ -1,3 +1,4 @@ +import { peek } from "@thi.ng/arrays"; import { defmulti } from "@thi.ng/defmulti"; import { IShape, @@ -6,7 +7,6 @@ import { Type } from "@thi.ng/geom-api"; import { simplify as _simplify } from "@thi.ng/geom-resample"; -import { peek } from "@thi.ng/transducers"; import { Vec } from "@thi.ng/vectors"; import { dispatch } from "../internal/dispatch"; import { vertices } from "./vertices"; From 5efda384f94edf1cbfcde303e105886a23a06ad2 Mon Sep 17 00:00:00 2001 From: Karsten Schmidt Date: Tue, 12 Feb 2019 14:54:45 +0000 Subject: [PATCH 13/33] refactor(geom-accel): update to use @thi.ng/arrays --- packages/geom-accel/package.json | 3 ++- packages/geom-accel/src/kdtree.ts | 2 +- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/packages/geom-accel/package.json b/packages/geom-accel/package.json index b9b802f40f..6219bd5773 100644 --- a/packages/geom-accel/package.json +++ b/packages/geom-accel/package.json @@ -33,6 +33,7 @@ }, "dependencies": { "@thi.ng/api": "^5.0.2", + "@thi.ng/arrays": "^0.0.1", "@thi.ng/geom-api": "^0.1.1", "@thi.ng/heaps": "^1.0.2", "@thi.ng/math": "^1.1.0", @@ -56,4 +57,4 @@ "access": "public" }, "sideEffects": false -} +} \ No newline at end of file diff --git a/packages/geom-accel/src/kdtree.ts b/packages/geom-accel/src/kdtree.ts index 96379029e6..6ee04a4f3e 100644 --- a/packages/geom-accel/src/kdtree.ts +++ b/packages/geom-accel/src/kdtree.ts @@ -1,8 +1,8 @@ import { ICopy, Pair } from "@thi.ng/api"; +import { ensureArray } from "@thi.ng/arrays"; import { ISpatialAccel } from "@thi.ng/geom-api"; import { Heap } from "@thi.ng/heaps"; import { EPS } from "@thi.ng/math"; -import { ensureArray } from "@thi.ng/transducers"; import { distSq, ReadonlyVec, Vec } from "@thi.ng/vectors"; const CMP = (a, b) => b[0] - a[0]; From 5ce96937373ea974895cb1744e8c76a08baa6763 Mon Sep 17 00:00:00 2001 From: Karsten Schmidt Date: Tue, 12 Feb 2019 14:55:44 +0000 Subject: [PATCH 14/33] minor(heaps): minor updates --- packages/heaps/src/heap.ts | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/packages/heaps/src/heap.ts b/packages/heaps/src/heap.ts index f396ba8fd1..f2e7b8aa76 100644 --- a/packages/heaps/src/heap.ts +++ b/packages/heaps/src/heap.ts @@ -173,11 +173,11 @@ export class Heap implements if (!n) { return res; } - let x = res[n - 1], y; + let x = res[n - 1], y: T; for (let i = n, m = vals.length; i < m; i++) { y = vals[i]; if (cmp(y, x) < 0) { - res.splice(binarySearch(res, y, 0, n, cmp), 0, y); + res.splice(binarySearch(y, res, 0, n, cmp), 0, y); res.pop(); x = res[n - 1]; } @@ -244,7 +244,13 @@ export class Heap implements } } -function binarySearch(vals: T[], x: T, lo: number, hi: number, cmp: Comparator) { +const binarySearch = ( + x: T, + vals: T[], + lo: number, + hi: number, + cmp: Comparator +) => { let m; while (lo < hi) { m = (lo + hi) >>> 1; @@ -255,4 +261,4 @@ function binarySearch(vals: T[], x: T, lo: number, hi: number, cmp: Comparato } } return lo; -} +}; From 3a74bf1aa430850533f26bf77291a24e97217f82 Mon Sep 17 00:00:00 2001 From: Karsten Schmidt Date: Tue, 12 Feb 2019 14:56:20 +0000 Subject: [PATCH 15/33] refactor(hiccup-markdown): update to use @thi.ng/arrays --- packages/hiccup-markdown/package.json | 3 ++- packages/hiccup-markdown/src/parse.ts | 2 +- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/packages/hiccup-markdown/package.json b/packages/hiccup-markdown/package.json index e4a790e6cf..3111c24737 100644 --- a/packages/hiccup-markdown/package.json +++ b/packages/hiccup-markdown/package.json @@ -32,6 +32,7 @@ "typescript": "^3.2.2" }, "dependencies": { + "@thi.ng/arrays": "^0.0.1", "@thi.ng/checks": "^2.1.0", "@thi.ng/defmulti": "^1.0.2", "@thi.ng/errors": "^1.0.2", @@ -56,4 +57,4 @@ "access": "public" }, "sideEffects": false -} +} \ No newline at end of file diff --git a/packages/hiccup-markdown/src/parse.ts b/packages/hiccup-markdown/src/parse.ts index 359288c269..26a5babb2d 100644 --- a/packages/hiccup-markdown/src/parse.ts +++ b/packages/hiccup-markdown/src/parse.ts @@ -1,3 +1,4 @@ +import { peek } from "@thi.ng/arrays"; import { alts, fsm, @@ -9,7 +10,6 @@ import { untilStr, whitespace } from "@thi.ng/fsm"; -import { peek } from "@thi.ng/transducers"; import { TagFactories } from "./api"; type ParseResult = ResultBody; From 5a7e44814438d8f20b0e7201b5a2e2e5cf046f99 Mon Sep 17 00:00:00 2001 From: Karsten Schmidt Date: Tue, 12 Feb 2019 14:57:02 +0000 Subject: [PATCH 16/33] fix(random): add opt scale arg to IRandom.float() --- packages/random/src/api.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/random/src/api.ts b/packages/random/src/api.ts index 3cc92b0296..2e405bc872 100644 --- a/packages/random/src/api.ts +++ b/packages/random/src/api.ts @@ -2,7 +2,7 @@ import { ICopy } from "@thi.ng/api"; export interface IRandom { int(): number; - float(): number; + float(norm?: number): number; norm(scale?: number): number; minmax(min: number, max: number): number; gaussian(samples?: number, offset?: number, scale?: number): number; From b0b41f79ac77fe895d31756f9a780dc881797158 Mon Sep 17 00:00:00 2001 From: Karsten Schmidt Date: Tue, 12 Feb 2019 14:58:04 +0000 Subject: [PATCH 17/33] refactor(examples): update to use @thi.ng/arrays --- examples/canvas-dial/package.json | 1 + examples/canvas-dial/src/dial.ts | 2 +- examples/gesture-analysis/package.json | 1 + examples/gesture-analysis/src/index.ts | 2 +- examples/rstream-hdom/package.json | 1 + examples/rstream-hdom/src/index.ts | 2 +- examples/xml-converter/package.json | 1 + examples/xml-converter/src/format.ts | 2 +- 8 files changed, 8 insertions(+), 4 deletions(-) diff --git a/examples/canvas-dial/package.json b/examples/canvas-dial/package.json index 6fe997818c..46bebe7e0a 100644 --- a/examples/canvas-dial/package.json +++ b/examples/canvas-dial/package.json @@ -16,6 +16,7 @@ }, "dependencies": { "@thi.ng/api": "latest", + "@thi.ng/arrays": "latest", "@thi.ng/checks": "latest", "@thi.ng/hdom": "latest", "@thi.ng/hdom-components": "latest", diff --git a/examples/canvas-dial/src/dial.ts b/examples/canvas-dial/src/dial.ts index cce1fe211b..48fa362893 100644 --- a/examples/canvas-dial/src/dial.ts +++ b/examples/canvas-dial/src/dial.ts @@ -1,10 +1,10 @@ import { Fn } from "@thi.ng/api"; +import { peek } from "@thi.ng/arrays"; import { isString } from "@thi.ng/checks"; import { canvas2D } from "@thi.ng/hdom-components"; import { fitClamped } from "@thi.ng/math"; import { Subscription } from "@thi.ng/rstream"; import { GestureEvent, gestureStream, GestureType } from "@thi.ng/rstream-gestures"; -import { peek } from "@thi.ng/transducers"; import { heading, sub2 } from "@thi.ng/vectors"; /** diff --git a/examples/gesture-analysis/package.json b/examples/gesture-analysis/package.json index 8c0a4f1ff9..d1b13a7fa6 100644 --- a/examples/gesture-analysis/package.json +++ b/examples/gesture-analysis/package.json @@ -15,6 +15,7 @@ "typescript": "^3.2.2" }, "dependencies": { + "@thi.ng/arrays": "latest", "@thi.ng/hiccup-svg": "latest", "@thi.ng/rstream": "latest", "@thi.ng/rstream-gestures": "latest", diff --git a/examples/gesture-analysis/src/index.ts b/examples/gesture-analysis/src/index.ts index 1d42722b09..6fb9bd0bac 100644 --- a/examples/gesture-analysis/src/index.ts +++ b/examples/gesture-analysis/src/index.ts @@ -1,3 +1,4 @@ +import { peek } from "@thi.ng/arrays"; import { polyline as gPolyline, resample, vertices } from "@thi.ng/geom"; import { circle, @@ -14,7 +15,6 @@ import { map, multiplexObj, partition, - peek, push, transduce } from "@thi.ng/transducers"; diff --git a/examples/rstream-hdom/package.json b/examples/rstream-hdom/package.json index c78c6361aa..931e769ad6 100644 --- a/examples/rstream-hdom/package.json +++ b/examples/rstream-hdom/package.json @@ -15,6 +15,7 @@ "typescript": "^3.2.2" }, "dependencies": { + "@thi.ng/arrays": "latest", "@thi.ng/rstream": "latest", "@thi.ng/transducers": "latest", "@thi.ng/transducers-hdom": "latest" diff --git a/examples/rstream-hdom/src/index.ts b/examples/rstream-hdom/src/index.ts index 56b79ba5a3..dd64e55e12 100644 --- a/examples/rstream-hdom/src/index.ts +++ b/examples/rstream-hdom/src/index.ts @@ -1,3 +1,4 @@ +import { peek } from "@thi.ng/arrays"; import { fromRAF, ISubscribable, @@ -8,7 +9,6 @@ import { } from "@thi.ng/rstream"; import { map, - peek, reducer, scan, vals diff --git a/examples/xml-converter/package.json b/examples/xml-converter/package.json index 62410ee370..cd4947d7e2 100644 --- a/examples/xml-converter/package.json +++ b/examples/xml-converter/package.json @@ -16,6 +16,7 @@ "typescript": "^3.2.2" }, "dependencies": { + "@thi.ng/arrays": "latest", "@thi.ng/checks": "latest", "@thi.ng/defmulti": "latest", "@thi.ng/rstream": "latest", diff --git a/examples/xml-converter/src/format.ts b/examples/xml-converter/src/format.ts index 13986f74e7..881661331c 100644 --- a/examples/xml-converter/src/format.ts +++ b/examples/xml-converter/src/format.ts @@ -1,3 +1,4 @@ +import { peek } from "@thi.ng/arrays"; import { isArray, isBoolean, @@ -6,7 +7,6 @@ import { } from "@thi.ng/checks"; import { DEFAULT, defmulti } from "@thi.ng/defmulti"; import { repeat } from "@thi.ng/strings"; -import { peek } from "@thi.ng/transducers"; export interface FormatOpts { indent: number; From f719724d4186eb54c6776fca4dcfe12a39cad67c Mon Sep 17 00:00:00 2001 From: Karsten Schmidt Date: Tue, 12 Feb 2019 15:35:46 +0000 Subject: [PATCH 18/33] feat(random): add randomID() & weightedRandom() --- packages/random/src/index.ts | 3 ++ packages/random/src/random-id.ts | 28 ++++++++++++++++++ packages/random/src/weighted-random.ts | 40 ++++++++++++++++++++++++++ 3 files changed, 71 insertions(+) create mode 100644 packages/random/src/random-id.ts create mode 100644 packages/random/src/weighted-random.ts diff --git a/packages/random/src/index.ts b/packages/random/src/index.ts index ce7ff7a364..d928606e8f 100644 --- a/packages/random/src/index.ts +++ b/packages/random/src/index.ts @@ -4,3 +4,6 @@ export * from "./system"; export * from "./xorshift128"; export * from "./xorwow"; export * from "./xsadd"; + +export * from "./random-id"; +export * from "./weighted-random"; diff --git a/packages/random/src/random-id.ts b/packages/random/src/random-id.ts new file mode 100644 index 0000000000..fe032f51eb --- /dev/null +++ b/packages/random/src/random-id.ts @@ -0,0 +1,28 @@ +import { IRandom } from "./api"; +import { SYSTEM } from "./system"; + +/** + * Generates and returns a random string of `len` characters (default + * 4), plus optional given `prefix` and using only provided `syms` + * characters (default lowercase a-z). + * + * ``` + * randomID() + * "qgdt" + * + * randomID(8, "id-", "0123456789ABCDEF") + * "id-94EF6E1A" + * ``` + * + * @param len + * @param prefix + * @param syms + * @param rnd + */ +export const randomID = + (len = 4, prefix = "", syms = "abcdefghijklmnopqrstuvwxyz", rnd: IRandom = SYSTEM) => { + for (const n = syms.length; --len >= 0;) { + prefix += syms[rnd.float(n) | 0]; + } + return prefix; + }; diff --git a/packages/random/src/weighted-random.ts b/packages/random/src/weighted-random.ts new file mode 100644 index 0000000000..6abe7d89f1 --- /dev/null +++ b/packages/random/src/weighted-random.ts @@ -0,0 +1,40 @@ +import { IRandom } from "./api"; +import { SYSTEM } from "./system"; + +/** + * Returns a no-arg function which produces a random choice of given + * weighted `choices` and using given `IRandom` instance (default: + * `SYSTEM`). If `weights` are given, it must be the same size as + * `choices`. If omitted, each choice will have same probability. + * + * https://www.electricmonk.nl/log/2009/12/23/weighted-random-distribution/ + * + * @param choices + * @param weights + */ +export const weightedRandom = ( + choices: Array, + weights?: ArrayLike, + rnd: IRandom = SYSTEM +) => { + const opts = choices.map( + weights ? + (x, i) => <[T, number]>[x, weights[i]] : + (x) => <[T, number]>[x, 1] + ).sort((a, b) => b[1] - a[1]); + const n = choices.length; + let total = 0, i: number, r: number, sum: number; + for (i = 0; i < n; i++) { + total += opts[i][1]; + } + return () => { + r = rnd.float(total); + sum = total; + for (i = 0; i < n; i++) { + sum -= opts[i][1]; + if (sum <= r) { + return opts[i][0]; + } + } + }; +}; From 4b0eec633544d07c053c3880f1312adfcd13a64f Mon Sep 17 00:00:00 2001 From: Karsten Schmidt Date: Tue, 12 Feb 2019 15:37:42 +0000 Subject: [PATCH 19/33] refactor(transducers): remove obsolete randomID() & weightedRandom() BREAKING CHANGE: migrate randomID() & weightedRandom() to @thi.ng/random - update choices() iterator --- packages/transducers/src/func/random-id.ts | 25 ------------- .../transducers/src/func/weighted-random.ts | 36 ------------------- packages/transducers/src/iter/choices.ts | 8 ++--- 3 files changed, 4 insertions(+), 65 deletions(-) delete mode 100644 packages/transducers/src/func/random-id.ts delete mode 100644 packages/transducers/src/func/weighted-random.ts diff --git a/packages/transducers/src/func/random-id.ts b/packages/transducers/src/func/random-id.ts deleted file mode 100644 index 5979d8aed5..0000000000 --- a/packages/transducers/src/func/random-id.ts +++ /dev/null @@ -1,25 +0,0 @@ -import { IRandom, SYSTEM } from "@thi.ng/random"; -import { choices } from "../iter/choices"; -import { take } from "../xform/take"; - -/** - * Generates and returns a random string of `len` characters (default - * 4), plus optional given `prefix` and using only provided `syms` - * characters (default lowercase a-z). - * - * ``` - * randomID() - * "qgdt" - * - * randomID(8, "id-", "0123456789ABCDEF") - * "id-94EF6E1A" - * ``` - * - * @param len - * @param prefix - * @param syms - * @param rnd - */ -export const randomID = - (len = 4, prefix = "", syms = "abcdefghijklmnopqrstuvwxyz", rnd: IRandom = SYSTEM) => - [prefix, ...take(len, choices(syms, null, rnd))].join(""); diff --git a/packages/transducers/src/func/weighted-random.ts b/packages/transducers/src/func/weighted-random.ts deleted file mode 100644 index 52c26deb4d..0000000000 --- a/packages/transducers/src/func/weighted-random.ts +++ /dev/null @@ -1,36 +0,0 @@ -import { IRandom, SYSTEM } from "@thi.ng/random"; -import { repeat } from "../iter/repeat"; -import { zip } from "../iter/zip"; - -/** - * Returns a no-arg function which produces a random choice of given - * weighted `choices`. If `weights` are given, it must be the same size - * as `choices`. If omitted, each choice will have same probability. - * - * https://www.electricmonk.nl/log/2009/12/23/weighted-random-distribution/ - * - * @param choices - * @param weights - */ -export const weightedRandom = ( - choices: ArrayLike & Iterable, - weights?: ArrayLike & Iterable, - rnd: IRandom = SYSTEM -) => { - const n = choices.length; - const opts = [...zip(choices, weights || repeat(1))].sort((a, b) => b[1] - a[1]); - let total = 0, i, r, sum; - for (i = 0; i < n; i++) { - total += opts[i][1]; - } - return () => { - r = rnd.float(total); - sum = total; - for (i = 0; i < n; i++) { - sum -= opts[i][1]; - if (sum <= r) { - return opts[i][0]; - } - } - }; -}; diff --git a/packages/transducers/src/iter/choices.ts b/packages/transducers/src/iter/choices.ts index 73858bdc26..7b21adae5e 100644 --- a/packages/transducers/src/iter/choices.ts +++ b/packages/transducers/src/iter/choices.ts @@ -1,6 +1,6 @@ -import { weightedRandom } from "../func/weighted-random"; +import { ensureArray } from "@thi.ng/arrays"; +import { IRandom, SYSTEM, weightedRandom } from "@thi.ng/random"; import { repeatedly } from "./repeatedly"; -import { IRandom, SYSTEM } from "@thi.ng/random"; /** * Returns an infinite iterator of random choices and their (optional) @@ -19,11 +19,11 @@ import { IRandom, SYSTEM } from "@thi.ng/random"; */ export const choices = ( choices: ArrayLike & Iterable, - weights?: ArrayLike & Iterable, + weights?: ArrayLike, rnd: IRandom = SYSTEM ) => repeatedly( weights ? - weightedRandom(choices, weights, rnd) : + weightedRandom(ensureArray(choices), weights, rnd) : () => choices[(rnd.float(choices.length) | 0)] ); From dd13fa9da4841d77863446746e2a6d0ce1fc0edd Mon Sep 17 00:00:00 2001 From: Karsten Schmidt Date: Tue, 12 Feb 2019 15:49:31 +0000 Subject: [PATCH 20/33] feat(compose): add new functions - add constantly() - add delay() - add delayed() - add identity() --- packages/compose/src/constantly.ts | 4 ++++ packages/compose/src/delay.ts | 29 +++++++++++++++++++++++++++++ packages/compose/src/delayed.ts | 3 +++ packages/compose/src/identity.ts | 1 + packages/compose/src/index.ts | 4 ++++ 5 files changed, 41 insertions(+) create mode 100644 packages/compose/src/constantly.ts create mode 100644 packages/compose/src/delay.ts create mode 100644 packages/compose/src/delayed.ts create mode 100644 packages/compose/src/identity.ts diff --git a/packages/compose/src/constantly.ts b/packages/compose/src/constantly.ts new file mode 100644 index 0000000000..2f758a5fc7 --- /dev/null +++ b/packages/compose/src/constantly.ts @@ -0,0 +1,4 @@ +import { FnAny } from "@thi.ng/api"; + +export const constantly = + (x: T): FnAny => () => x; diff --git a/packages/compose/src/delay.ts b/packages/compose/src/delay.ts new file mode 100644 index 0000000000..7b7efc4064 --- /dev/null +++ b/packages/compose/src/delay.ts @@ -0,0 +1,29 @@ +import { IDeref } from "@thi.ng/api"; + +export const delay = + (body: () => T) => new Delay(body); + +export class Delay implements + IDeref { + + value: T; + protected body: () => T; + protected realized: boolean; + + constructor(body: () => T) { + this.body = body; + this.realized = false; + } + + deref() { + if (!this.realized) { + this.value = this.body(); + this.realized = true; + } + return this.value; + } + + isRealized() { + return this.realized; + } +} diff --git a/packages/compose/src/delayed.ts b/packages/compose/src/delayed.ts new file mode 100644 index 0000000000..d250ef0f57 --- /dev/null +++ b/packages/compose/src/delayed.ts @@ -0,0 +1,3 @@ +export const delayed = + (x: T, t: number) => + new Promise((resolve) => setTimeout(() => resolve(x), t)); diff --git a/packages/compose/src/identity.ts b/packages/compose/src/identity.ts new file mode 100644 index 0000000000..74efbc8cf1 --- /dev/null +++ b/packages/compose/src/identity.ts @@ -0,0 +1 @@ +export const identity = (x: T) => x; diff --git a/packages/compose/src/index.ts b/packages/compose/src/index.ts index dfddd39435..f9c76d4c74 100644 --- a/packages/compose/src/index.ts +++ b/packages/compose/src/index.ts @@ -1,4 +1,8 @@ export * from "./comp"; +export * from "./constantly"; +export * from "./delay"; +export * from "./delayed"; +export * from "./identity"; export * from "./juxt"; export * from "./partial"; export * from "./thread-first"; From 05bf2131a9c0bd91eb20c9b39eba93c512a7c479 Mon Sep 17 00:00:00 2001 From: Karsten Schmidt Date: Tue, 12 Feb 2019 17:08:01 +0000 Subject: [PATCH 21/33] refactor(transducers): restructure, migrate / remove various functions BREAKING CHANGE: migrate / remove various functions to other packages - constantly(), delay(), identity() => @thi.ng/compose - randomID(), weightedRandom() => @thi.ng/random - remove re-exports: - even(), odd() (from @thi.ng/checks) - juxt() (from @thi.ng/compose) - remove obsolete hex() fn (use @thi.ng/strings fns instead) --- packages/transducers/src/func/constantly.ts | 2 -- packages/transducers/src/func/delay.ts | 3 --- packages/transducers/src/func/even.ts | 1 - packages/transducers/src/func/hex.ts | 10 ---------- packages/transducers/src/func/identity.ts | 1 - packages/transducers/src/func/juxt.ts | 3 --- packages/transducers/src/func/odd.ts | 1 - packages/transducers/src/index.ts | 9 --------- packages/transducers/src/rfn/frequencies.ts | 2 +- packages/transducers/src/rfn/group-by-map.ts | 4 ++-- packages/transducers/src/rfn/group-by-obj.ts | 2 +- packages/transducers/src/step.ts | 2 +- packages/transducers/src/xform/delayed.ts | 6 +++--- packages/transducers/src/xform/keep.ts | 2 +- packages/transducers/src/xform/moving-median.ts | 2 +- packages/transducers/src/xform/multiplex.ts | 2 +- packages/transducers/src/xform/partition-sort.ts | 3 +-- packages/transducers/src/xform/partition-sync.ts | 2 +- packages/transducers/src/xform/stream-sort.ts | 2 +- packages/transducers/test/permutations.ts | 4 ++-- 20 files changed, 16 insertions(+), 47 deletions(-) delete mode 100644 packages/transducers/src/func/constantly.ts delete mode 100644 packages/transducers/src/func/delay.ts delete mode 100644 packages/transducers/src/func/even.ts delete mode 100644 packages/transducers/src/func/hex.ts delete mode 100644 packages/transducers/src/func/identity.ts delete mode 100644 packages/transducers/src/func/juxt.ts delete mode 100644 packages/transducers/src/func/odd.ts diff --git a/packages/transducers/src/func/constantly.ts b/packages/transducers/src/func/constantly.ts deleted file mode 100644 index 514541cc8d..0000000000 --- a/packages/transducers/src/func/constantly.ts +++ /dev/null @@ -1,2 +0,0 @@ -export const constantly = - (x: T): (...args: any[]) => T => () => x; diff --git a/packages/transducers/src/func/delay.ts b/packages/transducers/src/func/delay.ts deleted file mode 100644 index c276804747..0000000000 --- a/packages/transducers/src/func/delay.ts +++ /dev/null @@ -1,3 +0,0 @@ -export const delay = - (x: T, t: number) => - new Promise((resolve) => setTimeout(() => resolve(x), t)); diff --git a/packages/transducers/src/func/even.ts b/packages/transducers/src/func/even.ts deleted file mode 100644 index 4fecc9bc95..0000000000 --- a/packages/transducers/src/func/even.ts +++ /dev/null @@ -1 +0,0 @@ -export { isEven as even } from "@thi.ng/checks"; diff --git a/packages/transducers/src/func/hex.ts b/packages/transducers/src/func/hex.ts deleted file mode 100644 index c2d5d6eb94..0000000000 --- a/packages/transducers/src/func/hex.ts +++ /dev/null @@ -1,10 +0,0 @@ -import { radix, Stringer } from "@thi.ng/strings"; - -/** - * @deprecated use thi.ng/strings `radix()` instead - * - * @param digits - * @param prefix - */ -export const hex = (digits = 2, prefix = ""): Stringer => - radix(16, digits, prefix); diff --git a/packages/transducers/src/func/identity.ts b/packages/transducers/src/func/identity.ts deleted file mode 100644 index 74efbc8cf1..0000000000 --- a/packages/transducers/src/func/identity.ts +++ /dev/null @@ -1 +0,0 @@ -export const identity = (x: T) => x; diff --git a/packages/transducers/src/func/juxt.ts b/packages/transducers/src/func/juxt.ts deleted file mode 100644 index 00b819d738..0000000000 --- a/packages/transducers/src/func/juxt.ts +++ /dev/null @@ -1,3 +0,0 @@ -import { juxt as _juxt } from "@thi.ng/compose"; - -export const juxt = _juxt; diff --git a/packages/transducers/src/func/odd.ts b/packages/transducers/src/func/odd.ts deleted file mode 100644 index ab3065656e..0000000000 --- a/packages/transducers/src/func/odd.ts +++ /dev/null @@ -1 +0,0 @@ -export { isOdd as odd } from "@thi.ng/checks"; diff --git a/packages/transducers/src/index.ts b/packages/transducers/src/index.ts index 03f409a86c..9201dedd9c 100644 --- a/packages/transducers/src/index.ts +++ b/packages/transducers/src/index.ts @@ -94,20 +94,11 @@ export * from "./xform/word-wrap"; export * from "./func/comp"; export * from "./func/compr"; -export * from "./func/constantly"; export * from "./func/deep-transform"; -export * from "./func/delay"; -export * from "./func/even"; -export * from "./func/hex"; -export * from "./func/identity"; -export * from "./func/juxt"; export * from "./func/juxtr"; export * from "./func/key-selector"; export * from "./func/lookup"; -export * from "./func/odd"; -export * from "./func/random-id"; export * from "./func/renamer"; -export * from "./func/weighted-random"; export * from "./iter/as-iterable"; export * from "./iter/choices"; diff --git a/packages/transducers/src/rfn/frequencies.ts b/packages/transducers/src/rfn/frequencies.ts index 1fa9467aa0..ac8794560d 100644 --- a/packages/transducers/src/rfn/frequencies.ts +++ b/packages/transducers/src/rfn/frequencies.ts @@ -1,6 +1,6 @@ import { Fn } from "@thi.ng/api"; +import { identity } from "@thi.ng/compose"; import { Reducer } from "../api"; -import { identity } from "../func/identity"; import { $$reduce } from "../reduce"; import { count } from "./count"; import { groupByMap } from "./group-by-map"; diff --git a/packages/transducers/src/rfn/group-by-map.ts b/packages/transducers/src/rfn/group-by-map.ts index 279d2b1eb8..cfeef605b5 100644 --- a/packages/transducers/src/rfn/group-by-map.ts +++ b/packages/transducers/src/rfn/group-by-map.ts @@ -1,5 +1,5 @@ -import { Reducer, GroupByOpts } from "../api"; -import { identity } from "../func/identity"; +import { identity } from "@thi.ng/compose"; +import { GroupByOpts, Reducer } from "../api"; import { $$reduce, reducer } from "../reduce"; import { push } from "./push"; diff --git a/packages/transducers/src/rfn/group-by-obj.ts b/packages/transducers/src/rfn/group-by-obj.ts index 0e075ed96c..5128f646c3 100644 --- a/packages/transducers/src/rfn/group-by-obj.ts +++ b/packages/transducers/src/rfn/group-by-obj.ts @@ -1,6 +1,6 @@ import { IObjectOf } from "@thi.ng/api"; +import { identity } from "@thi.ng/compose"; import { GroupByOpts, Reducer } from "../api"; -import { identity } from "../func/identity"; import { $$reduce, reducer } from "../reduce"; import { push } from "./push"; diff --git a/packages/transducers/src/step.ts b/packages/transducers/src/step.ts index eda33f1227..c6ab9d9c99 100644 --- a/packages/transducers/src/step.ts +++ b/packages/transducers/src/step.ts @@ -22,7 +22,7 @@ import { push } from "./rfn/push"; * // [ 1, 2, 3 ] * * // no result - * f = step(filter(even)) + * f = step(filter((x) => !(x & 1))) * f(1); // undefined * f(2); // 2 * diff --git a/packages/transducers/src/xform/delayed.ts b/packages/transducers/src/xform/delayed.ts index 5cadd02718..0b8718d2bd 100644 --- a/packages/transducers/src/xform/delayed.ts +++ b/packages/transducers/src/xform/delayed.ts @@ -1,9 +1,9 @@ import { Transducer } from "../api"; -import { delay } from "../func/delay"; +import { delayed as _delayed } from "@thi.ng/compose"; import { map } from "./map"; /** - * Yields transducer which wraps incoming values in promises, which + * Yields transducer which wraps incoming values in promises, which each * resolve after specified delay time (in ms). * * **Only to be used in async contexts and NOT with `transduce` @@ -13,4 +13,4 @@ import { map } from "./map"; */ export const delayed = (t: number): Transducer> => - map((x) => delay(x, t)); + map((x) => _delayed(x, t)); diff --git a/packages/transducers/src/xform/keep.ts b/packages/transducers/src/xform/keep.ts index 56110331d0..4b16e7fc3a 100644 --- a/packages/transducers/src/xform/keep.ts +++ b/packages/transducers/src/xform/keep.ts @@ -1,6 +1,6 @@ +import { identity } from "@thi.ng/compose"; import { Reducer, Transducer } from "../api"; import { compR } from "../func/compr"; -import { identity } from "../func/identity"; import { $iter } from "../iterator"; export function keep(pred?: (x: T) => any): Transducer; diff --git a/packages/transducers/src/xform/moving-median.ts b/packages/transducers/src/xform/moving-median.ts index 7833f27d1a..8f8b044075 100644 --- a/packages/transducers/src/xform/moving-median.ts +++ b/packages/transducers/src/xform/moving-median.ts @@ -1,7 +1,7 @@ import { compare as cmp } from "@thi.ng/compare"; +import { identity } from "@thi.ng/compose"; import { SortOpts, Transducer } from "../api"; import { comp } from "../func/comp"; -import { identity } from "../func/identity"; import { $iter } from "../iterator"; import { map } from "./map"; import { partition } from "./partition"; diff --git a/packages/transducers/src/xform/multiplex.ts b/packages/transducers/src/xform/multiplex.ts index 5b0d6c25d0..8d3ab9c5d5 100644 --- a/packages/transducers/src/xform/multiplex.ts +++ b/packages/transducers/src/xform/multiplex.ts @@ -1,5 +1,5 @@ +import { juxt } from "@thi.ng/compose"; import { Transducer } from "../api"; -import { juxt } from "../func/juxt"; import { step } from "../step"; import { map } from "./map"; diff --git a/packages/transducers/src/xform/partition-sort.ts b/packages/transducers/src/xform/partition-sort.ts index 625d3032c5..d4efaa780d 100644 --- a/packages/transducers/src/xform/partition-sort.ts +++ b/packages/transducers/src/xform/partition-sort.ts @@ -1,8 +1,7 @@ import { compare as cmp } from "@thi.ng/compare"; - +import { identity } from "@thi.ng/compose"; import { SortOpts, Transducer } from "../api"; import { comp } from "../func/comp"; -import { identity } from "../func/identity"; import { $iter, iterator } from "../iterator"; import { mapcat } from "./mapcat"; import { partition } from "./partition"; diff --git a/packages/transducers/src/xform/partition-sync.ts b/packages/transducers/src/xform/partition-sync.ts index c02e180bde..8b6f1b9afd 100644 --- a/packages/transducers/src/xform/partition-sync.ts +++ b/packages/transducers/src/xform/partition-sync.ts @@ -1,7 +1,7 @@ import { IObjectOf } from "@thi.ng/api"; import { isArray } from "@thi.ng/checks"; +import { identity } from "@thi.ng/compose"; import { Reducer, Transducer } from "../api"; -import { identity } from "../func/identity"; import { $iter, iterator } from "../iterator"; export interface PartitionSyncOpts { diff --git a/packages/transducers/src/xform/stream-sort.ts b/packages/transducers/src/xform/stream-sort.ts index 2b54136657..37c8e75bdc 100644 --- a/packages/transducers/src/xform/stream-sort.ts +++ b/packages/transducers/src/xform/stream-sort.ts @@ -1,7 +1,7 @@ import { binarySearch } from "@thi.ng/arrays"; import { compare as cmp } from "@thi.ng/compare"; +import { identity } from "@thi.ng/compose"; import { Reducer, SortOpts, Transducer } from "../api"; -import { identity } from "../func/identity"; import { $iter, iterator } from "../iterator"; import { isReduced } from "../reduced"; diff --git a/packages/transducers/test/permutations.ts b/packages/transducers/test/permutations.ts index ad3ce8a60a..241f45b265 100644 --- a/packages/transducers/test/permutations.ts +++ b/packages/transducers/test/permutations.ts @@ -1,4 +1,4 @@ -import { swizzler } from "@thi.ng/arrays"; +import { swizzle } from "@thi.ng/arrays"; import { permutations, permutationsN } from "../src/iter/permutations"; import { range } from "../src/iter/range"; import { iterator } from "../src/iterator"; @@ -41,7 +41,7 @@ describe("permutations", () => { }); it("swizzle", () => { assert.deepEqual( - [...iterator(map((x: string[]) => swizzler(x)({ x: 0, y: 1, z: 2 })), permutations("xyz", "xyz", "xyz"))], + [...iterator(map((x: string[]) => swizzle(x)({ x: 0, y: 1, z: 2 })), permutations("xyz", "xyz", "xyz"))], [...permutationsN(3)] ); }); From e9d57fcd720a1b44963bd75e4abf066fd9fa76b0 Mon Sep 17 00:00:00 2001 From: Karsten Schmidt Date: Tue, 12 Feb 2019 17:41:53 +0000 Subject: [PATCH 22/33] fix(compose): add varargs override for jux(), add tests --- packages/compose/src/juxt.ts | 5 +- packages/compose/test/delay.ts | 15 +++++ packages/compose/test/index.ts | 6 -- packages/compose/test/juxt.ts | 98 ++++++++++++++++++++++++++++++++ packages/compose/test/partial.ts | 41 +++++++++++++ 5 files changed, 157 insertions(+), 8 deletions(-) create mode 100644 packages/compose/test/delay.ts delete mode 100644 packages/compose/test/index.ts create mode 100644 packages/compose/test/juxt.ts create mode 100644 packages/compose/test/partial.ts diff --git a/packages/compose/src/juxt.ts b/packages/compose/src/juxt.ts index 4064f77b1c..a2b6167f0b 100644 --- a/packages/compose/src/juxt.ts +++ b/packages/compose/src/juxt.ts @@ -8,7 +8,8 @@ export function juxt(a: Fn, b: Fn, c: Fn, d: export function juxt(a: Fn, b: Fn, c: Fn, d: Fn, e: Fn, f: Fn): Fn; export function juxt(a: Fn, b: Fn, c: Fn, d: Fn, e: Fn, f: Fn, g: Fn): Fn; export function juxt(a: Fn, b: Fn, c: Fn, d: Fn, e: Fn, f: Fn, g: Fn, h: Fn): Fn; -export function juxt(...fns: Fn[]) { +export function juxt(a: Fn, b: Fn, c: Fn, d: Fn, e: Fn, f: Fn, g: Fn, h: Fn, ...xs: Fn[]): Fn; +export function juxt(...fns: Fn[]) { const [a, b, c, d, e, f, g, h] = fns; switch (fns.length) { case 1: @@ -28,7 +29,7 @@ export function juxt(...fns: Fn[]) { case 8: return (x) => [a(x), b(x), c(x), d(x), e(x), f(x), g(x), h(x)]; default: - return (x: any) => { + return (x: T) => { let res = new Array(fns.length); for (let i = fns.length; --i >= 0;) { res[i] = fns[i](x); diff --git a/packages/compose/test/delay.ts b/packages/compose/test/delay.ts new file mode 100644 index 0000000000..a03b216410 --- /dev/null +++ b/packages/compose/test/delay.ts @@ -0,0 +1,15 @@ +import { delay } from "../src"; + +import * as assert from "assert"; + +describe("delay", () => { + + it("only executes once", () => { + let num = 0; + const a = delay(() => ++num); + assert(!a.isRealized()); + assert.equal(a.deref(), 1); + assert.equal(a.deref(), 1); + assert(a.isRealized()); + }); +}); diff --git a/packages/compose/test/index.ts b/packages/compose/test/index.ts deleted file mode 100644 index 1a976f7f80..0000000000 --- a/packages/compose/test/index.ts +++ /dev/null @@ -1,6 +0,0 @@ -// import * as assert from "assert"; -// import * as compose from "../src/index"; - -describe("compose", () => { - it("tests pending"); -}); diff --git a/packages/compose/test/juxt.ts b/packages/compose/test/juxt.ts new file mode 100644 index 0000000000..394cdb427b --- /dev/null +++ b/packages/compose/test/juxt.ts @@ -0,0 +1,98 @@ +import { juxt } from "../src"; + +import * as assert from "assert"; + +describe("juxt", () => { + + it("2-args", () => { + const a = juxt( + (x: number) => x + 1, + (x: number) => x * 10 + ); + assert.deepEqual(a(1), [2, 10]); + }); + + it("3-args", () => { + const a = juxt( + (x: number) => x + 1, + (x: number) => x * 10, + (x: number) => "id-" + x + ); + assert.deepEqual(a(1), [2, 10, "id-1"]); + }); + + it("4-args", () => { + const a = juxt( + (x: number) => x + 1, + (x: number) => x * 10, + (x: number) => "id-" + x, + (x: number) => [x, x], + ); + assert.deepEqual(a(1), [2, 10, "id-1", [1, 1]]); + }); + + it("5-args", () => { + const a = juxt( + (x: number) => x + 1, + (x: number) => x * 10, + (x: number) => "id-" + x, + (x: number) => [x, x], + (x: number) => ({ a: x }), + ); + assert.deepEqual(a(1), [2, 10, "id-1", [1, 1], { a: 1 }]); + }); + + it("6-args", () => { + const a = juxt( + (x: number) => x + 1, + (x: number) => x - 1, + (x: number) => x * 10, + (x: number) => "id-" + x, + (x: number) => [x, x], + (x: number) => ({ a: x }), + ); + assert.deepEqual(a(1), [2, 0, 10, "id-1", [1, 1], { a: 1 }]); + }); + + it("7-args", () => { + const a = juxt( + (x: number) => x + 1, + (x: number) => x - 1, + (x: number) => x * 10, + (x: number) => x * 100, + (x: number) => "id-" + x, + (x: number) => [x, x], + (x: number) => ({ a: x }), + ); + assert.deepEqual(a(1), [2, 0, 10, 100, "id-1", [1, 1], { a: 1 }]); + }); + + it("8-args", () => { + const a = juxt( + (x: number) => x + 1, + (x: number) => x - 1, + (x: number) => x * 10, + (x: number) => x * 100, + (x: number) => x * 1000, + (x: number) => "id-" + x, + (x: number) => [x, x], + (x: number) => ({ a: x }), + ); + assert.deepEqual(a(1), [2, 0, 10, 100, 1000, "id-1", [1, 1], { a: 1 }]); + }); + + it("9-args", () => { + const a = juxt( + (x: number) => x + 1, + (x: number) => x - 1, + (x: number) => x * 10, + (x: number) => x * 100, + (x: number) => x * 1000, + (x: number) => x * 10000, + (x: number) => "id-" + x, + (x: number) => [x, x], + (x: number) => ({ a: x }), + ); + assert.deepEqual(a(1), [2, 0, 10, 100, 1000, 10000, "id-1", [1, 1], { a: 1 }]); + }); +}); diff --git a/packages/compose/test/partial.ts b/packages/compose/test/partial.ts new file mode 100644 index 0000000000..9c154f31bf --- /dev/null +++ b/packages/compose/test/partial.ts @@ -0,0 +1,41 @@ +import { partial } from "../src"; + +import * as assert from "assert"; + +describe("partial", () => { + + const fn = (a, b, c, d, e, f, g, h, i) => [a, b, c, d, e, f, g, h, i]; + const res = [0, 1, 2, 3, 4, 5, 6, 7, 8]; + + it("1-arg", () => { + assert.deepEqual(partial(fn, 0)(1, 2, 3, 4, 5, 6, 7, 8), res); + }); + + it("2-arg", () => { + assert.deepEqual(partial(fn, 0, 1)(2, 3, 4, 5, 6, 7, 8), res); + }); + + it("3-arg", () => { + assert.deepEqual(partial(fn, 0, 1, 2)(3, 4, 5, 6, 7, 8), res); + }); + + it("4-arg", () => { + assert.deepEqual(partial(fn, 0, 1, 2, 3)(4, 5, 6, 7, 8), res); + }); + + it("5-arg", () => { + assert.deepEqual(partial(fn, 0, 1, 2, 3, 4)(5, 6, 7, 8), res); + }); + + it("6-arg", () => { + assert.deepEqual(partial(fn, 0, 1, 2, 3, 4, 5)(6, 7, 8), res); + }); + + it("7-arg", () => { + assert.deepEqual(partial(fn, 0, 1, 2, 3, 4, 5, 6)(7, 8), res); + }); + + it("8-arg", () => { + assert.deepEqual(partial(fn, 0, 1, 2, 3, 4, 5, 6, 7)(8), res); + }); +}); From d6e3c3870f8e618526205e4d3fe49157405fc07f Mon Sep 17 00:00:00 2001 From: Karsten Schmidt Date: Tue, 12 Feb 2019 19:04:20 +0000 Subject: [PATCH 23/33] docs(malloc): update readme --- packages/malloc/README.md | 20 ++++++++++++++++++-- 1 file changed, 18 insertions(+), 2 deletions(-) diff --git a/packages/malloc/README.md b/packages/malloc/README.md index 4eb7bc6adc..111d8aca47 100644 --- a/packages/malloc/README.md +++ b/packages/malloc/README.md @@ -19,6 +19,8 @@ This project is part of the - [`mallocAs(type: Type, num: number)`](#mallocastype-type-num-number) - [`calloc(size: number)`](#callocsize-number) - [`callocAs(type: Type, num: number)`](#callocastype-type-num-number) + - [`realloc(addr: number, size: number)`](#reallocaddr-number-size-number) + - [`reallocArray(buf: TypedArray, num: number)`](#reallocarraybuf-typedarray-num-number) - [`free(addr: number | TypedArray)`](#freeaddr-number--typedarray) - [`freeAll()`](#freeall) - [`release()`](#release) @@ -35,8 +37,9 @@ TypeScript port of [thi.ng/tinyalloc](https://github.com/thi-ng/tinyalloc), for raw or typed array memory pooling and/or hybrid JS/WASM use cases etc. Supports free block compaction and configurable splitting. Unlike the original, -this implementation does not constrain the overall number of blocks in -use and the only imposed limit is that of the underlying array buffer. +this implementation also supports `realloc()` and does not constrain the +overall number of blocks in use and the only imposed limit is that of +the underlying array buffer. Each `MemPool` instance operates on a single large `ArrayBuffer` used as backing memory chunk, e.g. the same buffer used by a WASM module. @@ -172,6 +175,19 @@ preferred over `malloc()`. Like `mallocAs()` but zeroes allocated block before returning. +### `realloc(addr: number, size: number)` + +Attempts to adjust the size of the block at the given allocated address +to new `size` or if not possible, attempt to allocate a new block and +copies contents of current block (if successful, automatically frees old +address). Returns new address if successful or else 0. + +### `reallocArray(buf: TypedArray, num: number)` + +Similar to `realloc()`, but takes a typed array created with +`mallocAs()` / `callocAs()` and returns new arrays of same type or +`null` if re-allocation wasn't possible. + ### `free(addr: number | TypedArray)` Releases given address or array view back into the pool. Returns `true` From 77ed4c54b327bed1308cf6841da591780ba430c8 Mon Sep 17 00:00:00 2001 From: Karsten Schmidt Date: Tue, 12 Feb 2019 19:41:51 +0000 Subject: [PATCH 24/33] fix(transducers-binary): update juxt import --- packages/transducers-binary/package.json | 3 ++- packages/transducers-binary/src/hex-dump.ts | 2 +- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/packages/transducers-binary/package.json b/packages/transducers-binary/package.json index cff3b38638..d2f9ac18ef 100644 --- a/packages/transducers-binary/package.json +++ b/packages/transducers-binary/package.json @@ -32,6 +32,7 @@ "typescript": "^3.2.2" }, "dependencies": { + "@thi.ng/compose": "^1.0.2", "@thi.ng/strings": "^1.0.3", "@thi.ng/transducers": "^4.0.1" }, @@ -55,4 +56,4 @@ "access": "public" }, "sideEffects": false -} +} \ No newline at end of file diff --git a/packages/transducers-binary/src/hex-dump.ts b/packages/transducers-binary/src/hex-dump.ts index 5956e2868f..91a7ded3a1 100644 --- a/packages/transducers-binary/src/hex-dump.ts +++ b/packages/transducers-binary/src/hex-dump.ts @@ -1,9 +1,9 @@ +import { juxt } from "@thi.ng/compose"; import { U32, U8 } from "@thi.ng/strings"; import { $iter, comp, iterator, - juxt, map, mapIndexed, padLast, From 51959b757ca4dd4e517acf2b520563e113f62e74 Mon Sep 17 00:00:00 2001 From: Karsten Schmidt Date: Wed, 13 Feb 2019 22:15:54 +0000 Subject: [PATCH 25/33] fix(geom-accel): fix addAll(), addKeys() --- packages/geom-accel/src/kdtree.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/packages/geom-accel/src/kdtree.ts b/packages/geom-accel/src/kdtree.ts index 6ee04a4f3e..c55a0c0052 100644 --- a/packages/geom-accel/src/kdtree.ts +++ b/packages/geom-accel/src/kdtree.ts @@ -123,7 +123,7 @@ export class KdTree implements addAll(pts: Iterable>, eps = EPS) { let ok = true; for (let [k, v] of pts) { - ok = ok && this.add(k, v, eps); + ok = this.add(k, v, eps) && ok; } return ok; } @@ -135,7 +135,7 @@ export class KdTree implements addKeys(ks: Iterable>, eps = EPS) { let ok = true; for (let k of ks) { - ok = ok && this.add(k, null, eps); + ok = this.add(k, null, eps) && ok; } return ok; } From 0007152d4ec1df7aff8dc50246fdb2c29d584993 Mon Sep 17 00:00:00 2001 From: Karsten Schmidt Date: Thu, 14 Feb 2019 11:39:04 +0000 Subject: [PATCH 26/33] feat(arrays): add find/findIndex() --- packages/arrays/src/find.ts | 32 ++++++++++++++++++++++++++++++++ packages/arrays/src/index.ts | 1 + 2 files changed, 33 insertions(+) create mode 100644 packages/arrays/src/find.ts diff --git a/packages/arrays/src/find.ts b/packages/arrays/src/find.ts new file mode 100644 index 0000000000..206016fc28 --- /dev/null +++ b/packages/arrays/src/find.ts @@ -0,0 +1,32 @@ +import { Predicate2 } from "@thi.ng/api"; +import { equiv as _equiv } from "@thi.ng/equiv"; + +/** + * Similar to `Array.find()`, but uses thi.ng/equiv as default + * predicate. + * + * @param src + * @param x + * @param equiv + */ +export const find = + (src: ArrayLike, x: T, equiv: Predicate2 = _equiv) => { + const i = findIndex(src, x, equiv); + return i !== -1 ? src[i] : undefined; + }; + +/** + * Similar to `Array.findIndex()`, but uses thi.ng/equiv as default + * predicate. + * + * @param src + * @param x + * @param equiv + */ +export const findIndex = + (src: ArrayLike, x: T, equiv: Predicate2 = _equiv) => { + for (let i = src.length; --i >= 0;) { + if (equiv(x, src[i])) return i; + } + return -1; + }; diff --git a/packages/arrays/src/index.ts b/packages/arrays/src/index.ts index b1edbe0ed5..fa06b5b5a9 100644 --- a/packages/arrays/src/index.ts +++ b/packages/arrays/src/index.ts @@ -2,6 +2,7 @@ export * from "./binary-search"; export * from "./ends-with"; export * from "./ensure-array"; export * from "./ensure-iterable"; +export * from "./find"; export * from "./fuzzy-match"; export * from "./peek"; export * from "./shuffle"; From b01abaa5fbe4dff191d3b648902c188dfe7e52e5 Mon Sep 17 00:00:00 2001 From: Karsten Schmidt Date: Thu, 14 Feb 2019 11:40:01 +0000 Subject: [PATCH 27/33] refactor(arrays): update arg order, fix shuffle() --- packages/arrays/src/binary-search.ts | 4 ++-- packages/arrays/src/fuzzy-match.ts | 4 ++-- packages/arrays/src/shuffle.ts | 13 ++++++++++++- 3 files changed, 16 insertions(+), 5 deletions(-) diff --git a/packages/arrays/src/binary-search.ts b/packages/arrays/src/binary-search.ts index 5c94498386..ac9e708806 100644 --- a/packages/arrays/src/binary-search.ts +++ b/packages/arrays/src/binary-search.ts @@ -12,14 +12,14 @@ import { compare } from "@thi.ng/compare"; * to identify the index of `x`. The sort order of `buf` MUST be * compatible with that of `cmp`. * - * @param x * @param buf + * @param x * @param key * @param cmp */ export const binarySearch = ( - x: A, buf: ArrayLike, + x: A, key: Fn = (x) => x, cmp: Comparator = compare, ) => { diff --git a/packages/arrays/src/fuzzy-match.ts b/packages/arrays/src/fuzzy-match.ts index 1ef5a598be..b318a01d53 100644 --- a/packages/arrays/src/fuzzy-match.ts +++ b/packages/arrays/src/fuzzy-match.ts @@ -13,13 +13,13 @@ import { equiv as _eq } from "@thi.ng/equiv"; * * @see thi.ng/transducers/xform/filterFuzzy * - * @param query * @param domain + * @param query * @param equiv */ export const fuzzyMatch = ( - query: ArrayLike, domain: ArrayLike, + query: ArrayLike, equiv: Predicate2 = _eq ) => { const nd = domain.length; diff --git a/packages/arrays/src/shuffle.ts b/packages/arrays/src/shuffle.ts index 8e96af68cd..00821211b3 100644 --- a/packages/arrays/src/shuffle.ts +++ b/packages/arrays/src/shuffle.ts @@ -1,8 +1,19 @@ import { IRandom, SYSTEM } from "@thi.ng/random"; +/** + * Shuffles the first `n` items of given array, using Fisher-yates and + * optional `rnd` PRNG. If `n` is `undefined`, the entire array will be + * shuffled. + * + * + * @param buf + * @param n + * @param rnd + */ export const shuffle = (buf: any[], n = buf.length, rnd: IRandom = SYSTEM) => { - const l = buf.length; + n = Math.min(n, buf.length); + const l = n; if (l > 1) { n = Math.min(n, l); while (--n >= 0) { From f95ab38cfeaad74086a7656f0363a98094169e07 Mon Sep 17 00:00:00 2001 From: Karsten Schmidt Date: Thu, 14 Feb 2019 11:41:23 +0000 Subject: [PATCH 28/33] refactor(transducers): update thi.ng/arrays call sites --- packages/transducers/src/xform/filter-fuzzy.ts | 2 +- packages/transducers/src/xform/stream-sort.ts | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/packages/transducers/src/xform/filter-fuzzy.ts b/packages/transducers/src/xform/filter-fuzzy.ts index 3f68bebf5b..34235a37bf 100644 --- a/packages/transducers/src/xform/filter-fuzzy.ts +++ b/packages/transducers/src/xform/filter-fuzzy.ts @@ -35,6 +35,6 @@ export function filterFuzzy(...args: any[]): any { const query: ArrayLike = args[0]; const { key, equiv } = >(args[1] || {}); return filter( - (x: A) => fuzzyMatch(query, key != null ? key(x) : x, equiv) + (x: A) => fuzzyMatch(key != null ? key(x) : x, query, equiv) ); } diff --git a/packages/transducers/src/xform/stream-sort.ts b/packages/transducers/src/xform/stream-sort.ts index 37c8e75bdc..86b42e6927 100644 --- a/packages/transducers/src/xform/stream-sort.ts +++ b/packages/transducers/src/xform/stream-sort.ts @@ -44,7 +44,7 @@ export function streamSort(...args: any[]): any { return complete(acc); }, (acc, x) => { - const idx = binarySearch(x, buf, key, compare); + const idx = binarySearch(buf, x, key, compare); buf.splice(idx < 0 ? -(idx + 1) : idx, 0, x); if (buf.length === n) { acc = reduce(acc, buf.shift()); From 161d19d23aebd0f95dd36d4a6f849112b5be36bd Mon Sep 17 00:00:00 2001 From: Karsten Schmidt Date: Fri, 15 Feb 2019 13:03:52 +0000 Subject: [PATCH 29/33] feat(vectors): add fit, fit01, fit11 fns --- packages/vectors/src/fit.ts | 12 ++++++++++++ packages/vectors/src/index.ts | 1 + 2 files changed, 13 insertions(+) create mode 100644 packages/vectors/src/fit.ts diff --git a/packages/vectors/src/fit.ts b/packages/vectors/src/fit.ts new file mode 100644 index 0000000000..e40ec05aa0 --- /dev/null +++ b/packages/vectors/src/fit.ts @@ -0,0 +1,12 @@ +import { fit as _fit, fit01 as _fit01, fit11 as _fit11 } from "@thi.ng/math"; +import { ARGS_VVV, defHofOp } from "./internal/codegen"; +import { HOF_VVV, HOF_VVVVV } from "./internal/templates"; + +export const [fit, fit2, fit3, fit4] = + defHofOp(_fit, HOF_VVVVV, "o,a,b,c,d,e"); + +export const [fit01, fit01_2, fit01_3, fit01_4] = + defHofOp(_fit01, HOF_VVV, ARGS_VVV); + +export const [fit11, fit11_2, fit11_3, fit11_4] = + defHofOp(_fit11, HOF_VVV, ARGS_VVV); diff --git a/packages/vectors/src/index.ts b/packages/vectors/src/index.ts index 668fa0a8c2..355e027bc5 100644 --- a/packages/vectors/src/index.ts +++ b/packages/vectors/src/index.ts @@ -46,6 +46,7 @@ export * from "./empty"; export * from "./eqdelta"; export * from "./exp"; export * from "./face-forward"; +export * from "./fit"; export * from "./floor"; export * from "./fract"; export * from "./gvec"; From 74d77f3501233e0eaa9681f90f3fdd1624292baf Mon Sep 17 00:00:00 2001 From: Karsten Schmidt Date: Fri, 15 Feb 2019 13:04:58 +0000 Subject: [PATCH 30/33] refactor(vectors): improve tpl reuse --- packages/vectors/src/internal/templates.ts | 1 + packages/vectors/src/max.ts | 3 ++- packages/vectors/src/min.ts | 3 ++- packages/vectors/src/mod.ts | 6 ++---- packages/vectors/src/modn.ts | 6 ++---- 5 files changed, 9 insertions(+), 10 deletions(-) diff --git a/packages/vectors/src/internal/templates.ts b/packages/vectors/src/internal/templates.ts index a8acfdd1e3..2381cd3260 100644 --- a/packages/vectors/src/internal/templates.ts +++ b/packages/vectors/src/internal/templates.ts @@ -10,6 +10,7 @@ export const SET = ([o, a]) => `${o}=${a};`; export const SET_N = ([a]) => `${a}=n;` export const HOF_VVV = ([o, a, b, c]) => `${o}=op(${a},${b},${c});`; +export const HOF_VVVVV = ([o, a, b, c, d, e]) => `${o}=op(${a},${b},${c},${d},${e});` export const ADDM = ([o, a, b, c]) => `${o}=(${a}+${b})*${c};`; export const ADDM_N = ([o, a, b]) => `${o}=(${a}+${b})*n;`; diff --git a/packages/vectors/src/max.ts b/packages/vectors/src/max.ts index 020df3486b..dfb842f521 100644 --- a/packages/vectors/src/max.ts +++ b/packages/vectors/src/max.ts @@ -1,5 +1,6 @@ import { MultiVecOpVV, VecOpVV } from "./api"; import { defOp } from "./internal/codegen"; +import { FN2 } from "./internal/templates"; export const [max, max2, max3, max4] = - defOp(([o, a, b]) => `${o}=Math.max(${a},${b});`); + defOp(FN2("Math.max")); diff --git a/packages/vectors/src/min.ts b/packages/vectors/src/min.ts index b118587dcf..c70b77a965 100644 --- a/packages/vectors/src/min.ts +++ b/packages/vectors/src/min.ts @@ -1,5 +1,6 @@ import { MultiVecOpVV, VecOpVV } from "./api"; import { defOp } from "./internal/codegen"; +import { FN2 } from "./internal/templates"; export const [min, min2, min3, min4] = - defOp(([o, a, b]) => `${o}=Math.min(${a},${b});`); + defOp(FN2("Math.min")); diff --git a/packages/vectors/src/mod.ts b/packages/vectors/src/mod.ts index c5bb5091cc..2909107024 100644 --- a/packages/vectors/src/mod.ts +++ b/packages/vectors/src/mod.ts @@ -1,5 +1,3 @@ -import { MultiVecOpVV, VecOpVV } from "./api"; -import { defOp } from "./internal/codegen"; +import { defMathOp } from "./internal/codegen"; -export const [mod, mod2, mod3, mod4] = - defOp(([o, a, b]) => `${o}=${a}%${b};`); +export const [mod, mod2, mod3, mod4] = defMathOp("%"); diff --git a/packages/vectors/src/modn.ts b/packages/vectors/src/modn.ts index 4f570a719e..3ce1a88e85 100644 --- a/packages/vectors/src/modn.ts +++ b/packages/vectors/src/modn.ts @@ -1,5 +1,3 @@ -import { MultiVecOpVN, VecOpVN } from "./api"; -import { ARGS_VN, defOp } from "./internal/codegen"; +import { defMathNOp } from "./internal/codegen"; -export const [modN, modN2, modN3, modN4] = - defOp(([o, a]) => `${o}=${a}%n;`, ARGS_VN); +export const [modN, modN2, modN3, modN4] = defMathNOp("%"); From e0bad9c9faca058f22ae521a01e0f2bebf4c8867 Mon Sep 17 00:00:00 2001 From: Karsten Schmidt Date: Fri, 15 Feb 2019 13:20:22 +0000 Subject: [PATCH 31/33] docs(vectors): update readme --- packages/vectors/README.md | 3 +++ 1 file changed, 3 insertions(+) diff --git a/packages/vectors/README.md b/packages/vectors/README.md index 30106d2959..c17ae662c4 100644 --- a/packages/vectors/README.md +++ b/packages/vectors/README.md @@ -276,6 +276,9 @@ Functions for memory mapped, strided vectors (without requiring wrappers): ### Interpolation +- `fit` / `fit2` / `fit3` / `fit4` +- `fit01` / `fit01_2` / `fit01_3` / `fit01_4` +- `fit11` / `fit11_2` / `fit11_3` / `fit11_4` - `mix` / `mix2` / `mix3` / `mix4` - `mixN` / `mixN2` / `mixN3` / `mixN4` - `mixBilinear` / `mixBilinear2` / `mixBilinear3` / `mixBilinear4` From e7bc075c1c6611d601614ac4a08e5d974b354e8d Mon Sep 17 00:00:00 2001 From: Karsten Schmidt Date: Fri, 15 Feb 2019 13:48:02 +0000 Subject: [PATCH 32/33] build: add missing pkg descriptions --- packages/bencode/package.json | 2 +- packages/color/README.md | 4 ++-- packages/color/package.json | 4 ++-- packages/geom/package.json | 2 +- packages/hiccup-carbon-icons/package.json | 4 ++-- packages/transducers-binary/package.json | 2 +- packages/vector-pools/package.json | 4 ++-- 7 files changed, 11 insertions(+), 11 deletions(-) diff --git a/packages/bencode/package.json b/packages/bencode/package.json index f96bdf580b..e8647998f3 100644 --- a/packages/bencode/package.json +++ b/packages/bencode/package.json @@ -1,7 +1,7 @@ { "name": "@thi.ng/bencode", "version": "0.1.1", - "description": "TODO", + "description": "Bencode binary encoder / decoder with optional UTF8 encoding", "module": "./index.js", "main": "./lib/index.js", "umd:main": "./lib/index.umd.js", diff --git a/packages/color/README.md b/packages/color/README.md index 69d84b6881..50058c20ef 100644 --- a/packages/color/README.md +++ b/packages/color/README.md @@ -26,8 +26,8 @@ This project is part of the ## About -Raw, array-based, color operations, conversions and optional type -wrappers, based on +Raw, array-based, color operations, color space conversions, optional type +wrappers, multi-color gradients, based on [@thi.ng/vectors](https://github.com/thi-ng/umbrella/tree/master/packages/vectors). ### Color spaces / modes diff --git a/packages/color/package.json b/packages/color/package.json index 642eff4e78..547d87636a 100644 --- a/packages/color/package.json +++ b/packages/color/package.json @@ -1,7 +1,7 @@ { "name": "@thi.ng/color", "version": "0.1.4", - "description": "TODO", + "description": "Raw, array-based, color ops, conversions, opt. type wrappers, multi-color gradients", "module": "./index.js", "main": "./lib/index.js", "umd:main": "./lib/index.umd.js", @@ -75,4 +75,4 @@ "setTimeout": false }, "sideEffects": false -} +} \ No newline at end of file diff --git a/packages/geom/package.json b/packages/geom/package.json index c14a5f233e..81c127e2ac 100644 --- a/packages/geom/package.json +++ b/packages/geom/package.json @@ -1,7 +1,7 @@ { "name": "@thi.ng/geom", "version": "1.2.1", - "description": "TODO", + "description": "2D geometry types, polymorphic operations, SVG generation", "module": "./index.js", "main": "./lib/index.js", "umd:main": "./lib/index.umd.js", diff --git a/packages/hiccup-carbon-icons/package.json b/packages/hiccup-carbon-icons/package.json index b4ab41c86d..ede2207804 100644 --- a/packages/hiccup-carbon-icons/package.json +++ b/packages/hiccup-carbon-icons/package.json @@ -1,7 +1,7 @@ { "name": "@thi.ng/hiccup-carbon-icons", "version": "1.0.3", - "description": "TODO", + "description": "Full set of IBM's Carbon icons in hiccup format", "module": "./index.js", "main": "./lib/index.js", "umd:main": "./lib/index.umd.js", @@ -48,4 +48,4 @@ "access": "public" }, "sideEffects": false -} +} \ No newline at end of file diff --git a/packages/transducers-binary/package.json b/packages/transducers-binary/package.json index d2f9ac18ef..b70294751d 100644 --- a/packages/transducers-binary/package.json +++ b/packages/transducers-binary/package.json @@ -1,7 +1,7 @@ { "name": "@thi.ng/transducers-binary", "version": "0.1.1", - "description": "TODO", + "description": "Binary data related transducers & reducers", "module": "./index.js", "main": "./lib/index.js", "umd:main": "./lib/index.umd.js", diff --git a/packages/vector-pools/package.json b/packages/vector-pools/package.json index 5f522f6c4f..287af598ca 100644 --- a/packages/vector-pools/package.json +++ b/packages/vector-pools/package.json @@ -1,7 +1,7 @@ { "name": "@thi.ng/vector-pools", "version": "0.2.1", - "description": "TODO", + "description": "Data structures for managing & working with strided, memory mapped vectors", "module": "./index.js", "main": "./lib/index.js", "umd:main": "./lib/index.umd.js", @@ -57,4 +57,4 @@ "setTimeout": false }, "sideEffects": false -} +} \ No newline at end of file From 418f7af20c8ce3098e86bbc3a2377ccbac761b70 Mon Sep 17 00:00:00 2001 From: Karsten Schmidt Date: Fri, 15 Feb 2019 14:24:37 +0000 Subject: [PATCH 33/33] Publish - @thi.ng/arrays@0.1.0 - @thi.ng/associative@1.0.5 - @thi.ng/bencode@0.2.0 - @thi.ng/cache@1.0.5 - @thi.ng/color@0.1.5 - @thi.ng/compose@1.1.0 - @thi.ng/csp@1.0.5 - @thi.ng/dcons@2.0.5 - @thi.ng/dgraph@1.0.5 - @thi.ng/fsm@2.0.0 - @thi.ng/geom-accel@1.1.2 - @thi.ng/geom-api@0.1.2 - @thi.ng/geom-arc@0.1.2 - @thi.ng/geom-clip@0.0.4 - @thi.ng/geom-closest-point@0.1.2 - @thi.ng/geom-hull@0.0.4 - @thi.ng/geom-isec@0.1.2 - @thi.ng/geom-isoline@0.1.3 - @thi.ng/geom-poly-utils@0.1.2 - @thi.ng/geom-resample@0.1.2 - @thi.ng/geom-splines@0.1.2 - @thi.ng/geom-subdiv-curve@0.1.2 - @thi.ng/geom-tessellate@0.1.2 - @thi.ng/geom-voronoi@0.1.2 - @thi.ng/geom@1.2.2 - @thi.ng/hdom-canvas@1.1.4 - @thi.ng/hdom-components@3.0.5 - @thi.ng/heaps@1.0.3 - @thi.ng/hiccup-carbon-icons@1.0.4 - @thi.ng/hiccup-css@1.0.5 - @thi.ng/hiccup-markdown@1.0.5 - @thi.ng/hiccup-svg@3.1.4 - @thi.ng/iges@1.0.5 - @thi.ng/iterators@5.0.5 - @thi.ng/malloc@2.0.2 - @thi.ng/matrices@0.1.5 - @thi.ng/pointfree-lang@1.0.4 - @thi.ng/pointfree@1.0.4 - @thi.ng/poisson@0.2.2 - @thi.ng/random@1.1.0 - @thi.ng/range-coder@1.0.5 - @thi.ng/rstream-csp@1.0.5 - @thi.ng/rstream-dot@1.0.5 - @thi.ng/rstream-gestures@1.0.5 - @thi.ng/rstream-graph@3.0.5 - @thi.ng/rstream-log@2.0.5 - @thi.ng/rstream-query@1.0.5 - @thi.ng/rstream@2.0.5 - @thi.ng/sax@1.0.5 - @thi.ng/transducers-binary@0.2.0 - @thi.ng/transducers-fsm@1.0.5 - @thi.ng/transducers-hdom@2.0.5 - @thi.ng/transducers-stats@1.0.5 - @thi.ng/transducers@5.0.0 - @thi.ng/vector-pools@0.2.2 - @thi.ng/vectors@2.3.0 --- packages/arrays/CHANGELOG.md | 12 +++++++ packages/arrays/package.json | 6 ++-- packages/associative/CHANGELOG.md | 8 +++++ packages/associative/package.json | 6 ++-- packages/bencode/CHANGELOG.md | 11 ++++++ packages/bencode/package.json | 10 +++--- packages/cache/CHANGELOG.md | 8 +++++ packages/cache/package.json | 6 ++-- packages/color/CHANGELOG.md | 8 +++++ packages/color/package.json | 10 +++--- packages/compose/CHANGELOG.md | 16 +++++++++ packages/compose/package.json | 2 +- packages/csp/CHANGELOG.md | 8 +++++ packages/csp/package.json | 10 +++--- packages/dcons/CHANGELOG.md | 8 +++++ packages/dcons/package.json | 4 +-- packages/dgraph/CHANGELOG.md | 8 +++++ packages/dgraph/package.json | 6 ++-- packages/fsm/CHANGELOG.md | 18 ++++++++++ packages/fsm/package.json | 8 ++--- packages/geom-accel/CHANGELOG.md | 11 ++++++ packages/geom-accel/package.json | 14 ++++---- packages/geom-api/CHANGELOG.md | 8 +++++ packages/geom-api/package.json | 4 +-- packages/geom-arc/CHANGELOG.md | 8 +++++ packages/geom-arc/package.json | 8 ++--- packages/geom-clip/CHANGELOG.md | 8 +++++ packages/geom-clip/package.json | 8 ++--- packages/geom-closest-point/CHANGELOG.md | 8 +++++ packages/geom-closest-point/package.json | 4 +-- packages/geom-hull/CHANGELOG.md | 8 +++++ packages/geom-hull/package.json | 4 +-- packages/geom-isec/CHANGELOG.md | 8 +++++ packages/geom-isec/package.json | 8 ++--- packages/geom-isoline/CHANGELOG.md | 8 +++++ packages/geom-isoline/package.json | 6 ++-- packages/geom-poly-utils/CHANGELOG.md | 8 +++++ packages/geom-poly-utils/package.json | 6 ++-- packages/geom-resample/CHANGELOG.md | 8 +++++ packages/geom-resample/package.json | 8 ++--- packages/geom-splines/CHANGELOG.md | 8 +++++ packages/geom-splines/package.json | 10 +++--- packages/geom-subdiv-curve/CHANGELOG.md | 8 +++++ packages/geom-subdiv-curve/package.json | 8 ++--- packages/geom-tessellate/CHANGELOG.md | 8 +++++ packages/geom-tessellate/package.json | 12 +++---- packages/geom-voronoi/CHANGELOG.md | 8 +++++ packages/geom-voronoi/package.json | 10 +++--- packages/geom/CHANGELOG.md | 8 +++++ packages/geom/package.json | 40 ++++++++++----------- packages/hdom-canvas/CHANGELOG.md | 8 +++++ packages/hdom-canvas/package.json | 4 +-- packages/hdom-components/CHANGELOG.md | 8 +++++ packages/hdom-components/package.json | 6 ++-- packages/heaps/CHANGELOG.md | 8 +++++ packages/heaps/package.json | 2 +- packages/hiccup-carbon-icons/CHANGELOG.md | 8 +++++ packages/hiccup-carbon-icons/package.json | 4 +-- packages/hiccup-css/CHANGELOG.md | 8 +++++ packages/hiccup-css/package.json | 4 +-- packages/hiccup-markdown/CHANGELOG.md | 8 +++++ packages/hiccup-markdown/package.json | 10 +++--- packages/hiccup-svg/CHANGELOG.md | 8 +++++ packages/hiccup-svg/package.json | 4 +-- packages/iges/CHANGELOG.md | 8 +++++ packages/iges/package.json | 4 +-- packages/iterators/CHANGELOG.md | 8 +++++ packages/iterators/package.json | 4 +-- packages/malloc/CHANGELOG.md | 8 +++++ packages/malloc/package.json | 2 +- packages/matrices/CHANGELOG.md | 8 +++++ packages/matrices/package.json | 4 +-- packages/pointfree-lang/CHANGELOG.md | 8 +++++ packages/pointfree-lang/package.json | 4 +-- packages/pointfree/CHANGELOG.md | 8 +++++ packages/pointfree/package.json | 4 +-- packages/poisson/CHANGELOG.md | 8 +++++ packages/poisson/package.json | 8 ++--- packages/random/CHANGELOG.md | 16 +++++++++ packages/random/package.json | 2 +- packages/range-coder/CHANGELOG.md | 8 +++++ packages/range-coder/package.json | 4 +-- packages/rstream-csp/CHANGELOG.md | 8 +++++ packages/rstream-csp/package.json | 6 ++-- packages/rstream-dot/CHANGELOG.md | 8 +++++ packages/rstream-dot/package.json | 4 +-- packages/rstream-gestures/CHANGELOG.md | 8 +++++ packages/rstream-gestures/package.json | 6 ++-- packages/rstream-graph/CHANGELOG.md | 8 +++++ packages/rstream-graph/package.json | 6 ++-- packages/rstream-log/CHANGELOG.md | 8 +++++ packages/rstream-log/package.json | 6 ++-- packages/rstream-query/CHANGELOG.md | 8 +++++ packages/rstream-query/package.json | 10 +++--- packages/rstream/CHANGELOG.md | 8 +++++ packages/rstream/package.json | 6 ++-- packages/sax/CHANGELOG.md | 8 +++++ packages/sax/package.json | 6 ++-- packages/transducers-binary/CHANGELOG.md | 16 +++++++++ packages/transducers-binary/package.json | 8 ++--- packages/transducers-fsm/CHANGELOG.md | 8 +++++ packages/transducers-fsm/package.json | 4 +-- packages/transducers-hdom/CHANGELOG.md | 8 +++++ packages/transducers-hdom/package.json | 4 +-- packages/transducers-stats/CHANGELOG.md | 8 +++++ packages/transducers-stats/package.json | 6 ++-- packages/transducers/CHANGELOG.md | 43 +++++++++++++++++++++++ packages/transducers/package.json | 10 +++--- packages/vector-pools/CHANGELOG.md | 8 +++++ packages/vector-pools/package.json | 8 ++--- packages/vectors/CHANGELOG.md | 11 ++++++ packages/vectors/package.json | 6 ++-- 112 files changed, 722 insertions(+), 192 deletions(-) create mode 100644 packages/arrays/CHANGELOG.md diff --git a/packages/arrays/CHANGELOG.md b/packages/arrays/CHANGELOG.md new file mode 100644 index 0000000000..aae707cd1f --- /dev/null +++ b/packages/arrays/CHANGELOG.md @@ -0,0 +1,12 @@ +# Change Log + +All notable changes to this project will be documented in this file. +See [Conventional Commits](https://conventionalcommits.org) for commit guidelines. + +# 0.1.0 (2019-02-15) + + +### Features + +* **arrays:** add find/findIndex() ([0007152](https://github.com/thi-ng/umbrella/commit/0007152)) +* **arrays:** extract as new package ([361ba37](https://github.com/thi-ng/umbrella/commit/361ba37)) diff --git a/packages/arrays/package.json b/packages/arrays/package.json index 3954409541..5d48260326 100644 --- a/packages/arrays/package.json +++ b/packages/arrays/package.json @@ -1,6 +1,6 @@ { "name": "@thi.ng/arrays", - "version": "0.0.1", + "version": "0.1.0", "description": "Array / Arraylike utilities", "module": "./index.js", "main": "./lib/index.js", @@ -37,7 +37,7 @@ "@thi.ng/compare": "^1.0.2", "@thi.ng/equiv": "^1.0.2", "@thi.ng/errors": "^1.0.2", - "@thi.ng/random": "^1.0.2" + "@thi.ng/random": "^1.1.0" }, "keywords": [ "arrays", @@ -52,4 +52,4 @@ "access": "public" }, "sideEffects": false -} \ No newline at end of file +} diff --git a/packages/associative/CHANGELOG.md b/packages/associative/CHANGELOG.md index 65254203f9..4b5c4171f8 100644 --- a/packages/associative/CHANGELOG.md +++ b/packages/associative/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.5](https://github.com/thi-ng/umbrella/compare/@thi.ng/associative@1.0.4...@thi.ng/associative@1.0.5) (2019-02-15) + +**Note:** Version bump only for package @thi.ng/associative + + + + + ## [1.0.4](https://github.com/thi-ng/umbrella/compare/@thi.ng/associative@1.0.3...@thi.ng/associative@1.0.4) (2019-02-10) **Note:** Version bump only for package @thi.ng/associative diff --git a/packages/associative/package.json b/packages/associative/package.json index c6a1a7ba94..5df32c7ef5 100644 --- a/packages/associative/package.json +++ b/packages/associative/package.json @@ -1,6 +1,6 @@ { "name": "@thi.ng/associative", - "version": "1.0.4", + "version": "1.0.5", "description": "Alternative Set & Map data type implementations with customizable equality semantics & supporting operations", "module": "./index.js", "main": "./lib/index.js", @@ -35,10 +35,10 @@ "@thi.ng/api": "^5.0.2", "@thi.ng/checks": "^2.1.0", "@thi.ng/compare": "^1.0.2", - "@thi.ng/dcons": "^2.0.4", + "@thi.ng/dcons": "^2.0.5", "@thi.ng/equiv": "^1.0.2", "@thi.ng/errors": "^1.0.2", - "@thi.ng/transducers": "^4.0.1" + "@thi.ng/transducers": "^5.0.0" }, "keywords": [ "data structures", diff --git a/packages/bencode/CHANGELOG.md b/packages/bencode/CHANGELOG.md index 3cae5a1625..19eb64554d 100644 --- a/packages/bencode/CHANGELOG.md +++ b/packages/bencode/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. +# [0.2.0](https://github.com/thi-ng/umbrella/compare/@thi.ng/bencode@0.1.1...@thi.ng/bencode@0.2.0) (2019-02-15) + + +### Features + +* **bencode:** add decode(), fix string length handling ([c1bbc6f](https://github.com/thi-ng/umbrella/commit/c1bbc6f)) + + + + + ## [0.1.1](https://github.com/thi-ng/umbrella/compare/@thi.ng/bencode@0.1.0...@thi.ng/bencode@0.1.1) (2019-02-10) **Note:** Version bump only for package @thi.ng/bencode diff --git a/packages/bencode/package.json b/packages/bencode/package.json index e8647998f3..efc7aa1fec 100644 --- a/packages/bencode/package.json +++ b/packages/bencode/package.json @@ -1,6 +1,6 @@ { "name": "@thi.ng/bencode", - "version": "0.1.1", + "version": "0.2.0", "description": "Bencode binary encoder / decoder with optional UTF8 encoding", "module": "./index.js", "main": "./lib/index.js", @@ -33,12 +33,12 @@ }, "dependencies": { "@thi.ng/api": "^5.0.2", - "@thi.ng/arrays": "^0.0.1", + "@thi.ng/arrays": "^0.1.0", "@thi.ng/checks": "^2.1.0", "@thi.ng/defmulti": "^1.0.2", "@thi.ng/errors": "^1.0.2", - "@thi.ng/transducers": "^4.0.1", - "@thi.ng/transducers-binary": "^0.1.1" + "@thi.ng/transducers": "^5.0.0", + "@thi.ng/transducers-binary": "^0.2.0" }, "keywords": [ "bencode", @@ -54,4 +54,4 @@ "access": "public" }, "sideEffects": false -} \ No newline at end of file +} diff --git a/packages/cache/CHANGELOG.md b/packages/cache/CHANGELOG.md index 85259f87eb..9bcced7fb7 100644 --- a/packages/cache/CHANGELOG.md +++ b/packages/cache/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.5](https://github.com/thi-ng/umbrella/compare/@thi.ng/cache@1.0.4...@thi.ng/cache@1.0.5) (2019-02-15) + +**Note:** Version bump only for package @thi.ng/cache + + + + + ## [1.0.4](https://github.com/thi-ng/umbrella/compare/@thi.ng/cache@1.0.3...@thi.ng/cache@1.0.4) (2019-02-10) **Note:** Version bump only for package @thi.ng/cache diff --git a/packages/cache/package.json b/packages/cache/package.json index c683215b45..de8d4bfa43 100644 --- a/packages/cache/package.json +++ b/packages/cache/package.json @@ -1,6 +1,6 @@ { "name": "@thi.ng/cache", - "version": "1.0.4", + "version": "1.0.5", "description": "In-memory cache implementations with ES6 Map-like API and different eviction strategies", "module": "./index.js", "main": "./lib/index.js", @@ -33,8 +33,8 @@ }, "dependencies": { "@thi.ng/api": "^5.0.2", - "@thi.ng/dcons": "^2.0.4", - "@thi.ng/transducers": "^4.0.1" + "@thi.ng/dcons": "^2.0.5", + "@thi.ng/transducers": "^5.0.0" }, "keywords": [ "cache", diff --git a/packages/color/CHANGELOG.md b/packages/color/CHANGELOG.md index 4443f7947a..96a3976ea3 100644 --- a/packages/color/CHANGELOG.md +++ b/packages/color/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.5](https://github.com/thi-ng/umbrella/compare/@thi.ng/color@0.1.4...@thi.ng/color@0.1.5) (2019-02-15) + +**Note:** Version bump only for package @thi.ng/color + + + + + ## [0.1.4](https://github.com/thi-ng/umbrella/compare/@thi.ng/color@0.1.3...@thi.ng/color@0.1.4) (2019-02-10) **Note:** Version bump only for package @thi.ng/color diff --git a/packages/color/package.json b/packages/color/package.json index 547d87636a..3edd5a8693 100644 --- a/packages/color/package.json +++ b/packages/color/package.json @@ -1,6 +1,6 @@ { "name": "@thi.ng/color", - "version": "0.1.4", + "version": "0.1.5", "description": "Raw, array-based, color ops, conversions, opt. type wrappers, multi-color gradients", "module": "./index.js", "main": "./lib/index.js", @@ -33,13 +33,13 @@ }, "dependencies": { "@thi.ng/api": "^5.0.2", - "@thi.ng/compose": "^1.0.2", + "@thi.ng/compose": "^1.1.0", "@thi.ng/defmulti": "^1.0.2", "@thi.ng/errors": "^1.0.2", "@thi.ng/math": "^1.1.0", "@thi.ng/strings": "^1.0.3", - "@thi.ng/transducers": "^4.0.1", - "@thi.ng/vectors": "^2.2.1" + "@thi.ng/transducers": "^5.0.0", + "@thi.ng/vectors": "^2.3.0" }, "keywords": [ "alpha", @@ -75,4 +75,4 @@ "setTimeout": false }, "sideEffects": false -} \ No newline at end of file +} diff --git a/packages/compose/CHANGELOG.md b/packages/compose/CHANGELOG.md index 1ad36d601b..447461086c 100644 --- a/packages/compose/CHANGELOG.md +++ b/packages/compose/CHANGELOG.md @@ -3,6 +3,22 @@ All notable changes to this project will be documented in this file. See [Conventional Commits](https://conventionalcommits.org) for commit guidelines. +# [1.1.0](https://github.com/thi-ng/umbrella/compare/@thi.ng/compose@1.0.2...@thi.ng/compose@1.1.0) (2019-02-15) + + +### Bug Fixes + +* **compose:** add varargs override for jux(), add tests ([e9d57fc](https://github.com/thi-ng/umbrella/commit/e9d57fc)) + + +### Features + +* **compose:** add new functions ([dd13fa9](https://github.com/thi-ng/umbrella/commit/dd13fa9)) + + + + + ## [1.0.2](https://github.com/thi-ng/umbrella/compare/@thi.ng/compose@1.0.1...@thi.ng/compose@1.0.2) (2019-02-05) **Note:** Version bump only for package @thi.ng/compose diff --git a/packages/compose/package.json b/packages/compose/package.json index 847c3b26c3..de0acea472 100644 --- a/packages/compose/package.json +++ b/packages/compose/package.json @@ -1,6 +1,6 @@ { "name": "@thi.ng/compose", - "version": "1.0.2", + "version": "1.1.0", "description": "Arity-optimized functional composition helpers", "module": "./index.js", "main": "./lib/index.js", diff --git a/packages/csp/CHANGELOG.md b/packages/csp/CHANGELOG.md index a8059cdd59..4c9099c868 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. +## [1.0.5](https://github.com/thi-ng/umbrella/compare/@thi.ng/csp@1.0.4...@thi.ng/csp@1.0.5) (2019-02-15) + +**Note:** Version bump only for package @thi.ng/csp + + + + + ## [1.0.4](https://github.com/thi-ng/umbrella/compare/@thi.ng/csp@1.0.3...@thi.ng/csp@1.0.4) (2019-02-10) **Note:** Version bump only for package @thi.ng/csp diff --git a/packages/csp/package.json b/packages/csp/package.json index cd1df60f81..6461a69771 100644 --- a/packages/csp/package.json +++ b/packages/csp/package.json @@ -1,6 +1,6 @@ { "name": "@thi.ng/csp", - "version": "1.0.4", + "version": "1.0.5", "description": "ES6 promise based CSP implementation", "module": "./index.js", "main": "./lib/index.js", @@ -37,11 +37,11 @@ }, "dependencies": { "@thi.ng/api": "^5.0.2", - "@thi.ng/arrays": "^0.0.1", + "@thi.ng/arrays": "^0.1.0", "@thi.ng/checks": "^2.1.0", - "@thi.ng/dcons": "^2.0.4", + "@thi.ng/dcons": "^2.0.5", "@thi.ng/errors": "^1.0.2", - "@thi.ng/transducers": "^4.0.1" + "@thi.ng/transducers": "^5.0.0" }, "keywords": [ "async", @@ -60,4 +60,4 @@ "access": "public" }, "sideEffects": false -} \ No newline at end of file +} diff --git a/packages/dcons/CHANGELOG.md b/packages/dcons/CHANGELOG.md index a6f56a0f5c..5e5845e251 100644 --- a/packages/dcons/CHANGELOG.md +++ b/packages/dcons/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.0.5](https://github.com/thi-ng/umbrella/compare/@thi.ng/dcons@2.0.4...@thi.ng/dcons@2.0.5) (2019-02-15) + +**Note:** Version bump only for package @thi.ng/dcons + + + + + ## [2.0.4](https://github.com/thi-ng/umbrella/compare/@thi.ng/dcons@2.0.3...@thi.ng/dcons@2.0.4) (2019-02-10) **Note:** Version bump only for package @thi.ng/dcons diff --git a/packages/dcons/package.json b/packages/dcons/package.json index d053798f7f..0783d17ad0 100644 --- a/packages/dcons/package.json +++ b/packages/dcons/package.json @@ -1,6 +1,6 @@ { "name": "@thi.ng/dcons", - "version": "2.0.4", + "version": "2.0.5", "description": "Comprehensive doubly linked list structure w/ iterator support", "module": "./index.js", "main": "./lib/index.js", @@ -37,7 +37,7 @@ "@thi.ng/compare": "^1.0.2", "@thi.ng/equiv": "^1.0.2", "@thi.ng/errors": "^1.0.2", - "@thi.ng/transducers": "^4.0.1" + "@thi.ng/transducers": "^5.0.0" }, "keywords": [ "datastructure", diff --git a/packages/dgraph/CHANGELOG.md b/packages/dgraph/CHANGELOG.md index db27de994a..bc02c2a9c9 100644 --- a/packages/dgraph/CHANGELOG.md +++ b/packages/dgraph/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.5](https://github.com/thi-ng/umbrella/compare/@thi.ng/dgraph@1.0.4...@thi.ng/dgraph@1.0.5) (2019-02-15) + +**Note:** Version bump only for package @thi.ng/dgraph + + + + + ## [1.0.4](https://github.com/thi-ng/umbrella/compare/@thi.ng/dgraph@1.0.3...@thi.ng/dgraph@1.0.4) (2019-02-10) **Note:** Version bump only for package @thi.ng/dgraph diff --git a/packages/dgraph/package.json b/packages/dgraph/package.json index fced63b071..71750ad0be 100644 --- a/packages/dgraph/package.json +++ b/packages/dgraph/package.json @@ -1,6 +1,6 @@ { "name": "@thi.ng/dgraph", - "version": "1.0.4", + "version": "1.0.5", "description": "Type-agnostic directed acyclic graph (DAG) & graph operations", "module": "./index.js", "main": "./lib/index.js", @@ -33,10 +33,10 @@ }, "dependencies": { "@thi.ng/api": "^5.0.2", - "@thi.ng/associative": "^1.0.4", + "@thi.ng/associative": "^1.0.5", "@thi.ng/equiv": "^1.0.2", "@thi.ng/errors": "^1.0.2", - "@thi.ng/transducers": "^4.0.1" + "@thi.ng/transducers": "^5.0.0" }, "keywords": [ "data structure", diff --git a/packages/fsm/CHANGELOG.md b/packages/fsm/CHANGELOG.md index b1d7424555..ca6f3056ef 100644 --- a/packages/fsm/CHANGELOG.md +++ b/packages/fsm/CHANGELOG.md @@ -3,6 +3,24 @@ All notable changes to this project will be documented in this file. See [Conventional Commits](https://conventionalcommits.org) for commit guidelines. +# [2.0.0](https://github.com/thi-ng/umbrella/compare/@thi.ng/fsm@1.0.4...@thi.ng/fsm@2.0.0) (2019-02-15) + + +### Features + +* **fsm:** update / split until() ([aeb05f8](https://github.com/thi-ng/umbrella/commit/aeb05f8)) + + +### BREAKING CHANGES + +* **fsm:** make until() array based, add untilStr() + +- rename existing `until()` => `untilStr()` + + + + + ## [1.0.4](https://github.com/thi-ng/umbrella/compare/@thi.ng/fsm@1.0.3...@thi.ng/fsm@1.0.4) (2019-02-10) **Note:** Version bump only for package @thi.ng/fsm diff --git a/packages/fsm/package.json b/packages/fsm/package.json index 158751e3d4..bb03ae1936 100644 --- a/packages/fsm/package.json +++ b/packages/fsm/package.json @@ -1,6 +1,6 @@ { "name": "@thi.ng/fsm", - "version": "1.0.4", + "version": "2.0.0", "description": "Composable primitives for building declarative, transducer based Finite-State machines & parsers for arbitrary data streams", "module": "./index.js", "main": "./lib/index.js", @@ -33,10 +33,10 @@ }, "dependencies": { "@thi.ng/api": "^5.0.2", - "@thi.ng/arrays": "^0.0.1", + "@thi.ng/arrays": "^0.1.0", "@thi.ng/equiv": "^1.0.2", "@thi.ng/errors": "^1.0.2", - "@thi.ng/transducers": "^4.0.1" + "@thi.ng/transducers": "^5.0.0" }, "keywords": [ "ES6", @@ -56,4 +56,4 @@ "access": "public" }, "sideEffects": false -} \ No newline at end of file +} diff --git a/packages/geom-accel/CHANGELOG.md b/packages/geom-accel/CHANGELOG.md index b9747832c6..42ceb28bee 100644 --- a/packages/geom-accel/CHANGELOG.md +++ b/packages/geom-accel/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.1.2](https://github.com/thi-ng/umbrella/compare/@thi.ng/geom-accel@1.1.1...@thi.ng/geom-accel@1.1.2) (2019-02-15) + + +### Bug Fixes + +* **geom-accel:** fix addAll(), addKeys() ([51959b7](https://github.com/thi-ng/umbrella/commit/51959b7)) + + + + + ## [1.1.1](https://github.com/thi-ng/umbrella/compare/@thi.ng/geom-accel@1.1.0...@thi.ng/geom-accel@1.1.1) (2019-02-10) **Note:** Version bump only for package @thi.ng/geom-accel diff --git a/packages/geom-accel/package.json b/packages/geom-accel/package.json index 6219bd5773..02af997096 100644 --- a/packages/geom-accel/package.json +++ b/packages/geom-accel/package.json @@ -1,6 +1,6 @@ { "name": "@thi.ng/geom-accel", - "version": "1.1.1", + "version": "1.1.2", "description": "nD spatial indexing data structures", "module": "./index.js", "main": "./lib/index.js", @@ -33,12 +33,12 @@ }, "dependencies": { "@thi.ng/api": "^5.0.2", - "@thi.ng/arrays": "^0.0.1", - "@thi.ng/geom-api": "^0.1.1", - "@thi.ng/heaps": "^1.0.2", + "@thi.ng/arrays": "^0.1.0", + "@thi.ng/geom-api": "^0.1.2", + "@thi.ng/heaps": "^1.0.3", "@thi.ng/math": "^1.1.0", - "@thi.ng/transducers": "^4.0.1", - "@thi.ng/vectors": "^2.2.1" + "@thi.ng/transducers": "^5.0.0", + "@thi.ng/vectors": "^2.3.0" }, "keywords": [ "2D", @@ -57,4 +57,4 @@ "access": "public" }, "sideEffects": false -} \ No newline at end of file +} diff --git a/packages/geom-api/CHANGELOG.md b/packages/geom-api/CHANGELOG.md index 6084d96874..9f4b877323 100644 --- a/packages/geom-api/CHANGELOG.md +++ b/packages/geom-api/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.2](https://github.com/thi-ng/umbrella/compare/@thi.ng/geom-api@0.1.1...@thi.ng/geom-api@0.1.2) (2019-02-15) + +**Note:** Version bump only for package @thi.ng/geom-api + + + + + ## [0.1.1](https://github.com/thi-ng/umbrella/compare/@thi.ng/geom-api@0.1.0...@thi.ng/geom-api@0.1.1) (2019-02-10) **Note:** Version bump only for package @thi.ng/geom-api diff --git a/packages/geom-api/package.json b/packages/geom-api/package.json index 6af6fbed2c..c3c5da59d2 100644 --- a/packages/geom-api/package.json +++ b/packages/geom-api/package.json @@ -1,6 +1,6 @@ { "name": "@thi.ng/geom-api", - "version": "0.1.1", + "version": "0.1.2", "description": "Shared type & interface declarations for @thi.ng/geom packages", "module": "./index.js", "main": "./lib/index.js", @@ -33,7 +33,7 @@ }, "dependencies": { "@thi.ng/api": "^5.0.2", - "@thi.ng/vectors": "^2.2.1" + "@thi.ng/vectors": "^2.3.0" }, "keywords": [ "ES6", diff --git a/packages/geom-arc/CHANGELOG.md b/packages/geom-arc/CHANGELOG.md index 8ef6589326..fd7ae0bd1b 100644 --- a/packages/geom-arc/CHANGELOG.md +++ b/packages/geom-arc/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.2](https://github.com/thi-ng/umbrella/compare/@thi.ng/geom-arc@0.1.1...@thi.ng/geom-arc@0.1.2) (2019-02-15) + +**Note:** Version bump only for package @thi.ng/geom-arc + + + + + ## [0.1.1](https://github.com/thi-ng/umbrella/compare/@thi.ng/geom-arc@0.1.0...@thi.ng/geom-arc@0.1.1) (2019-02-10) **Note:** Version bump only for package @thi.ng/geom-arc diff --git a/packages/geom-arc/package.json b/packages/geom-arc/package.json index 60cbbae06e..b8d2c02fc9 100644 --- a/packages/geom-arc/package.json +++ b/packages/geom-arc/package.json @@ -1,6 +1,6 @@ { "name": "@thi.ng/geom-arc", - "version": "0.1.1", + "version": "0.1.2", "description": "2D circular / elliptic arc operations", "module": "./index.js", "main": "./lib/index.js", @@ -33,10 +33,10 @@ }, "dependencies": { "@thi.ng/checks": "^2.1.0", - "@thi.ng/geom-api": "^0.1.1", - "@thi.ng/geom-resample": "^0.1.1", + "@thi.ng/geom-api": "^0.1.2", + "@thi.ng/geom-resample": "^0.1.2", "@thi.ng/math": "^1.1.0", - "@thi.ng/vectors": "^2.2.1" + "@thi.ng/vectors": "^2.3.0" }, "keywords": [ "2D", diff --git a/packages/geom-clip/CHANGELOG.md b/packages/geom-clip/CHANGELOG.md index b9d872b025..b2373ba8ed 100644 --- a/packages/geom-clip/CHANGELOG.md +++ b/packages/geom-clip/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.0.4](https://github.com/thi-ng/umbrella/compare/@thi.ng/geom-clip@0.0.3...@thi.ng/geom-clip@0.0.4) (2019-02-15) + +**Note:** Version bump only for package @thi.ng/geom-clip + + + + + ## [0.0.3](https://github.com/thi-ng/umbrella/compare/@thi.ng/geom-clip@0.0.2...@thi.ng/geom-clip@0.0.3) (2019-02-10) **Note:** Version bump only for package @thi.ng/geom-clip diff --git a/packages/geom-clip/package.json b/packages/geom-clip/package.json index 5bd320d956..c64ced490c 100644 --- a/packages/geom-clip/package.json +++ b/packages/geom-clip/package.json @@ -1,6 +1,6 @@ { "name": "@thi.ng/geom-clip", - "version": "0.0.3", + "version": "0.0.4", "description": "2D line & convex polygon clipping (Liang-Barsky / Sutherland-Hodgeman)", "module": "./index.js", "main": "./lib/index.js", @@ -32,10 +32,10 @@ "typescript": "^3.2.2" }, "dependencies": { - "@thi.ng/geom-isec": "^0.1.1", - "@thi.ng/geom-poly-utils": "^0.1.1", + "@thi.ng/geom-isec": "^0.1.2", + "@thi.ng/geom-poly-utils": "^0.1.2", "@thi.ng/math": "^1.1.0", - "@thi.ng/vectors": "^2.2.1" + "@thi.ng/vectors": "^2.3.0" }, "keywords": [ "2D", diff --git a/packages/geom-closest-point/CHANGELOG.md b/packages/geom-closest-point/CHANGELOG.md index 4686de8cd9..274ef7df92 100644 --- a/packages/geom-closest-point/CHANGELOG.md +++ b/packages/geom-closest-point/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.2](https://github.com/thi-ng/umbrella/compare/@thi.ng/geom-closest-point@0.1.1...@thi.ng/geom-closest-point@0.1.2) (2019-02-15) + +**Note:** Version bump only for package @thi.ng/geom-closest-point + + + + + ## [0.1.1](https://github.com/thi-ng/umbrella/compare/@thi.ng/geom-closest-point@0.1.0...@thi.ng/geom-closest-point@0.1.1) (2019-02-10) **Note:** Version bump only for package @thi.ng/geom-closest-point diff --git a/packages/geom-closest-point/package.json b/packages/geom-closest-point/package.json index ed923dfd63..6520d10f79 100644 --- a/packages/geom-closest-point/package.json +++ b/packages/geom-closest-point/package.json @@ -1,6 +1,6 @@ { "name": "@thi.ng/geom-closest-point", - "version": "0.1.1", + "version": "0.1.2", "description": "Closest point / proximity helpers", "module": "./index.js", "main": "./lib/index.js", @@ -32,7 +32,7 @@ "typescript": "^3.2.2" }, "dependencies": { - "@thi.ng/vectors": "^2.2.1" + "@thi.ng/vectors": "^2.3.0" }, "keywords": [ "ES6", diff --git a/packages/geom-hull/CHANGELOG.md b/packages/geom-hull/CHANGELOG.md index c231fce41b..0d6e2e9178 100644 --- a/packages/geom-hull/CHANGELOG.md +++ b/packages/geom-hull/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.0.4](https://github.com/thi-ng/umbrella/compare/@thi.ng/geom-hull@0.0.3...@thi.ng/geom-hull@0.0.4) (2019-02-15) + +**Note:** Version bump only for package @thi.ng/geom-hull + + + + + ## [0.0.3](https://github.com/thi-ng/umbrella/compare/@thi.ng/geom-hull@0.0.2...@thi.ng/geom-hull@0.0.3) (2019-02-10) **Note:** Version bump only for package @thi.ng/geom-hull diff --git a/packages/geom-hull/package.json b/packages/geom-hull/package.json index 1b9d9c376f..7a810f47e8 100644 --- a/packages/geom-hull/package.json +++ b/packages/geom-hull/package.json @@ -1,6 +1,6 @@ { "name": "@thi.ng/geom-hull", - "version": "0.0.3", + "version": "0.0.4", "description": "Fast 2D convex hull (Graham Scan)", "module": "./index.js", "main": "./lib/index.js", @@ -33,7 +33,7 @@ }, "dependencies": { "@thi.ng/math": "^1.1.0", - "@thi.ng/vectors": "^2.2.1" + "@thi.ng/vectors": "^2.3.0" }, "keywords": [ "2D", diff --git a/packages/geom-isec/CHANGELOG.md b/packages/geom-isec/CHANGELOG.md index b51d9d36dc..883cdde307 100644 --- a/packages/geom-isec/CHANGELOG.md +++ b/packages/geom-isec/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.2](https://github.com/thi-ng/umbrella/compare/@thi.ng/geom-isec@0.1.1...@thi.ng/geom-isec@0.1.2) (2019-02-15) + +**Note:** Version bump only for package @thi.ng/geom-isec + + + + + ## [0.1.1](https://github.com/thi-ng/umbrella/compare/@thi.ng/geom-isec@0.1.0...@thi.ng/geom-isec@0.1.1) (2019-02-10) **Note:** Version bump only for package @thi.ng/geom-isec diff --git a/packages/geom-isec/package.json b/packages/geom-isec/package.json index af0b03f9b7..48c86ccacb 100644 --- a/packages/geom-isec/package.json +++ b/packages/geom-isec/package.json @@ -1,6 +1,6 @@ { "name": "@thi.ng/geom-isec", - "version": "0.1.1", + "version": "0.1.2", "description": "2D/3D shape intersection checks", "module": "./index.js", "main": "./lib/index.js", @@ -32,10 +32,10 @@ "typescript": "^3.2.2" }, "dependencies": { - "@thi.ng/geom-api": "^0.1.1", - "@thi.ng/geom-closest-point": "^0.1.1", + "@thi.ng/geom-api": "^0.1.2", + "@thi.ng/geom-closest-point": "^0.1.2", "@thi.ng/math": "^1.1.0", - "@thi.ng/vectors": "^2.2.1" + "@thi.ng/vectors": "^2.3.0" }, "keywords": [ "2D", diff --git a/packages/geom-isoline/CHANGELOG.md b/packages/geom-isoline/CHANGELOG.md index a01c515907..9282f7008b 100644 --- a/packages/geom-isoline/CHANGELOG.md +++ b/packages/geom-isoline/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.3](https://github.com/thi-ng/umbrella/compare/@thi.ng/geom-isoline@0.1.2...@thi.ng/geom-isoline@0.1.3) (2019-02-15) + +**Note:** Version bump only for package @thi.ng/geom-isoline + + + + + ## [0.1.2](https://github.com/thi-ng/umbrella/compare/@thi.ng/geom-isoline@0.1.1...@thi.ng/geom-isoline@0.1.2) (2019-02-11) diff --git a/packages/geom-isoline/package.json b/packages/geom-isoline/package.json index 9939932ecc..78096bc371 100644 --- a/packages/geom-isoline/package.json +++ b/packages/geom-isoline/package.json @@ -1,6 +1,6 @@ { "name": "@thi.ng/geom-isoline", - "version": "0.1.2", + "version": "0.1.3", "description": "Fast 2D contour line extraction / generation", "module": "./index.js", "main": "./lib/index.js", @@ -32,8 +32,8 @@ "typescript": "^3.2.2" }, "dependencies": { - "@thi.ng/transducers": "^4.0.1", - "@thi.ng/vectors": "^2.2.1" + "@thi.ng/transducers": "^5.0.0", + "@thi.ng/vectors": "^2.3.0" }, "keywords": [ "2D", diff --git a/packages/geom-poly-utils/CHANGELOG.md b/packages/geom-poly-utils/CHANGELOG.md index 12e2587a12..d687a3e98a 100644 --- a/packages/geom-poly-utils/CHANGELOG.md +++ b/packages/geom-poly-utils/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.2](https://github.com/thi-ng/umbrella/compare/@thi.ng/geom-poly-utils@0.1.1...@thi.ng/geom-poly-utils@0.1.2) (2019-02-15) + +**Note:** Version bump only for package @thi.ng/geom-poly-utils + + + + + ## [0.1.1](https://github.com/thi-ng/umbrella/compare/@thi.ng/geom-poly-utils@0.1.0...@thi.ng/geom-poly-utils@0.1.1) (2019-02-10) **Note:** Version bump only for package @thi.ng/geom-poly-utils diff --git a/packages/geom-poly-utils/package.json b/packages/geom-poly-utils/package.json index 263f287320..38f1fbba65 100644 --- a/packages/geom-poly-utils/package.json +++ b/packages/geom-poly-utils/package.json @@ -1,6 +1,6 @@ { "name": "@thi.ng/geom-poly-utils", - "version": "0.1.1", + "version": "0.1.2", "description": "Polygon / triangle analysis & processing utilities", "module": "./index.js", "main": "./lib/index.js", @@ -33,9 +33,9 @@ }, "dependencies": { "@thi.ng/errors": "^1.0.2", - "@thi.ng/geom-api": "^0.1.1", + "@thi.ng/geom-api": "^0.1.2", "@thi.ng/math": "^1.1.0", - "@thi.ng/vectors": "^2.2.1" + "@thi.ng/vectors": "^2.3.0" }, "keywords": [ "2D", diff --git a/packages/geom-resample/CHANGELOG.md b/packages/geom-resample/CHANGELOG.md index 3ee49641d0..6a5346dcc9 100644 --- a/packages/geom-resample/CHANGELOG.md +++ b/packages/geom-resample/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.2](https://github.com/thi-ng/umbrella/compare/@thi.ng/geom-resample@0.1.1...@thi.ng/geom-resample@0.1.2) (2019-02-15) + +**Note:** Version bump only for package @thi.ng/geom-resample + + + + + ## [0.1.1](https://github.com/thi-ng/umbrella/compare/@thi.ng/geom-resample@0.1.0...@thi.ng/geom-resample@0.1.1) (2019-02-10) **Note:** Version bump only for package @thi.ng/geom-resample diff --git a/packages/geom-resample/package.json b/packages/geom-resample/package.json index ea6cd6bf18..56478c1620 100644 --- a/packages/geom-resample/package.json +++ b/packages/geom-resample/package.json @@ -1,6 +1,6 @@ { "name": "@thi.ng/geom-resample", - "version": "0.1.1", + "version": "0.1.2", "description": "Customizable nD polyline interpolation, re-sampling, splitting & nearest point computation", "module": "./index.js", "main": "./lib/index.js", @@ -33,10 +33,10 @@ }, "dependencies": { "@thi.ng/checks": "^2.1.0", - "@thi.ng/geom-api": "^0.1.1", - "@thi.ng/geom-closest-point": "^0.1.1", + "@thi.ng/geom-api": "^0.1.2", + "@thi.ng/geom-closest-point": "^0.1.2", "@thi.ng/math": "^1.1.0", - "@thi.ng/vectors": "^2.2.1" + "@thi.ng/vectors": "^2.3.0" }, "keywords": [ "2D", diff --git a/packages/geom-splines/CHANGELOG.md b/packages/geom-splines/CHANGELOG.md index 8589f7ec4f..7d9ad7a0d5 100644 --- a/packages/geom-splines/CHANGELOG.md +++ b/packages/geom-splines/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.2](https://github.com/thi-ng/umbrella/compare/@thi.ng/geom-splines@0.1.1...@thi.ng/geom-splines@0.1.2) (2019-02-15) + +**Note:** Version bump only for package @thi.ng/geom-splines + + + + + ## [0.1.1](https://github.com/thi-ng/umbrella/compare/@thi.ng/geom-splines@0.1.0...@thi.ng/geom-splines@0.1.1) (2019-02-10) **Note:** Version bump only for package @thi.ng/geom-splines diff --git a/packages/geom-splines/package.json b/packages/geom-splines/package.json index 09c97bff46..6d1db39ed1 100644 --- a/packages/geom-splines/package.json +++ b/packages/geom-splines/package.json @@ -1,6 +1,6 @@ { "name": "@thi.ng/geom-splines", - "version": "0.1.1", + "version": "0.1.2", "description": "nD cubic & quadratic curve analysis, conversion, interpolation, splitting", "module": "./index.js", "main": "./lib/index.js", @@ -33,11 +33,11 @@ }, "dependencies": { "@thi.ng/checks": "^2.1.0", - "@thi.ng/geom-api": "^0.1.1", - "@thi.ng/geom-arc": "^0.1.1", - "@thi.ng/geom-resample": "^0.1.1", + "@thi.ng/geom-api": "^0.1.2", + "@thi.ng/geom-arc": "^0.1.2", + "@thi.ng/geom-resample": "^0.1.2", "@thi.ng/math": "^1.1.0", - "@thi.ng/vectors": "^2.2.1" + "@thi.ng/vectors": "^2.3.0" }, "keywords": [ "2D", diff --git a/packages/geom-subdiv-curve/CHANGELOG.md b/packages/geom-subdiv-curve/CHANGELOG.md index 029f6b38f4..39ba3d2ab4 100644 --- a/packages/geom-subdiv-curve/CHANGELOG.md +++ b/packages/geom-subdiv-curve/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.2](https://github.com/thi-ng/umbrella/compare/@thi.ng/geom-subdiv-curve@0.1.1...@thi.ng/geom-subdiv-curve@0.1.2) (2019-02-15) + +**Note:** Version bump only for package @thi.ng/geom-subdiv-curve + + + + + ## [0.1.1](https://github.com/thi-ng/umbrella/compare/@thi.ng/geom-subdiv-curve@0.1.0...@thi.ng/geom-subdiv-curve@0.1.1) (2019-02-10) **Note:** Version bump only for package @thi.ng/geom-subdiv-curve diff --git a/packages/geom-subdiv-curve/package.json b/packages/geom-subdiv-curve/package.json index 6b1efe63a0..d84add2ae2 100644 --- a/packages/geom-subdiv-curve/package.json +++ b/packages/geom-subdiv-curve/package.json @@ -1,6 +1,6 @@ { "name": "@thi.ng/geom-subdiv-curve", - "version": "0.1.1", + "version": "0.1.2", "description": "Freely customizable, iterative subdivision curves for open / closed input geometries", "module": "./index.js", "main": "./lib/index.js", @@ -32,9 +32,9 @@ "typescript": "^3.2.2" }, "dependencies": { - "@thi.ng/geom-api": "^0.1.1", - "@thi.ng/transducers": "^4.0.1", - "@thi.ng/vectors": "^2.2.1" + "@thi.ng/geom-api": "^0.1.2", + "@thi.ng/transducers": "^5.0.0", + "@thi.ng/vectors": "^2.3.0" }, "keywords": [ "2D", diff --git a/packages/geom-tessellate/CHANGELOG.md b/packages/geom-tessellate/CHANGELOG.md index d083261e7c..8c82580bba 100644 --- a/packages/geom-tessellate/CHANGELOG.md +++ b/packages/geom-tessellate/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.2](https://github.com/thi-ng/umbrella/compare/@thi.ng/geom-tessellate@0.1.1...@thi.ng/geom-tessellate@0.1.2) (2019-02-15) + +**Note:** Version bump only for package @thi.ng/geom-tessellate + + + + + ## [0.1.1](https://github.com/thi-ng/umbrella/compare/@thi.ng/geom-tessellate@0.1.0...@thi.ng/geom-tessellate@0.1.1) (2019-02-10) **Note:** Version bump only for package @thi.ng/geom-tessellate diff --git a/packages/geom-tessellate/package.json b/packages/geom-tessellate/package.json index b32108fdb6..f2b1584dff 100644 --- a/packages/geom-tessellate/package.json +++ b/packages/geom-tessellate/package.json @@ -1,6 +1,6 @@ { "name": "@thi.ng/geom-tessellate", - "version": "0.1.1", + "version": "0.1.2", "description": "2D/3D polygon tessellators", "module": "./index.js", "main": "./lib/index.js", @@ -33,11 +33,11 @@ }, "dependencies": { "@thi.ng/checks": "^2.1.0", - "@thi.ng/geom-api": "^0.1.1", - "@thi.ng/geom-isec": "^0.1.1", - "@thi.ng/geom-poly-utils": "^0.1.1", - "@thi.ng/transducers": "^4.0.1", - "@thi.ng/vectors": "^2.2.1" + "@thi.ng/geom-api": "^0.1.2", + "@thi.ng/geom-isec": "^0.1.2", + "@thi.ng/geom-poly-utils": "^0.1.2", + "@thi.ng/transducers": "^5.0.0", + "@thi.ng/vectors": "^2.3.0" }, "keywords": [ "2D", diff --git a/packages/geom-voronoi/CHANGELOG.md b/packages/geom-voronoi/CHANGELOG.md index 5abd8c7739..7a754af923 100644 --- a/packages/geom-voronoi/CHANGELOG.md +++ b/packages/geom-voronoi/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.2](https://github.com/thi-ng/umbrella/compare/@thi.ng/geom-voronoi@0.1.1...@thi.ng/geom-voronoi@0.1.2) (2019-02-15) + +**Note:** Version bump only for package @thi.ng/geom-voronoi + + + + + ## [0.1.1](https://github.com/thi-ng/umbrella/compare/@thi.ng/geom-voronoi@0.1.0...@thi.ng/geom-voronoi@0.1.1) (2019-02-10) **Note:** Version bump only for package @thi.ng/geom-voronoi diff --git a/packages/geom-voronoi/package.json b/packages/geom-voronoi/package.json index e31928650e..6a177caaa5 100644 --- a/packages/geom-voronoi/package.json +++ b/packages/geom-voronoi/package.json @@ -1,6 +1,6 @@ { "name": "@thi.ng/geom-voronoi", - "version": "0.1.1", + "version": "0.1.2", "description": "Fast, incremental 2D Delaunay & Voronoi mesh implementation", "module": "./index.js", "main": "./lib/index.js", @@ -34,12 +34,12 @@ "dependencies": { "@thi.ng/api": "^5.0.2", "@thi.ng/checks": "^2.1.0", - "@thi.ng/geom-clip": "^0.0.3", - "@thi.ng/geom-isec": "^0.1.1", - "@thi.ng/geom-poly-utils": "^0.1.1", + "@thi.ng/geom-clip": "^0.0.4", + "@thi.ng/geom-isec": "^0.1.2", + "@thi.ng/geom-poly-utils": "^0.1.2", "@thi.ng/math": "^1.1.0", "@thi.ng/quad-edge": "^0.1.0", - "@thi.ng/vectors": "^2.2.1" + "@thi.ng/vectors": "^2.3.0" }, "keywords": [ "2D", diff --git a/packages/geom/CHANGELOG.md b/packages/geom/CHANGELOG.md index 076244a3c9..58b1c7f8ee 100644 --- a/packages/geom/CHANGELOG.md +++ b/packages/geom/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.2.2](https://github.com/thi-ng/umbrella/compare/@thi.ng/geom@1.2.1...@thi.ng/geom@1.2.2) (2019-02-15) + +**Note:** Version bump only for package @thi.ng/geom + + + + + ## [1.2.1](https://github.com/thi-ng/umbrella/compare/@thi.ng/geom@1.2.0...@thi.ng/geom@1.2.1) (2019-02-10) **Note:** Version bump only for package @thi.ng/geom diff --git a/packages/geom/package.json b/packages/geom/package.json index 81c127e2ac..bfa69397dc 100644 --- a/packages/geom/package.json +++ b/packages/geom/package.json @@ -1,6 +1,6 @@ { "name": "@thi.ng/geom", - "version": "1.2.1", + "version": "1.2.2", "description": "2D geometry types, polymorphic operations, SVG generation", "module": "./index.js", "main": "./lib/index.js", @@ -33,30 +33,30 @@ }, "dependencies": { "@thi.ng/api": "^5.0.2", - "@thi.ng/arrays": "^0.0.1", + "@thi.ng/arrays": "^0.1.0", "@thi.ng/checks": "^2.1.0", - "@thi.ng/compose": "^1.0.2", + "@thi.ng/compose": "^1.1.0", "@thi.ng/defmulti": "^1.0.2", "@thi.ng/equiv": "^1.0.2", "@thi.ng/errors": "^1.0.2", - "@thi.ng/geom-api": "^0.1.1", - "@thi.ng/geom-arc": "^0.1.1", - "@thi.ng/geom-clip": "^0.0.3", - "@thi.ng/geom-closest-point": "^0.1.1", - "@thi.ng/geom-hull": "^0.0.3", - "@thi.ng/geom-isec": "^0.1.1", - "@thi.ng/geom-poly-utils": "^0.1.1", - "@thi.ng/geom-resample": "^0.1.1", - "@thi.ng/geom-splines": "^0.1.1", - "@thi.ng/geom-subdiv-curve": "^0.1.1", - "@thi.ng/geom-tessellate": "^0.1.1", + "@thi.ng/geom-api": "^0.1.2", + "@thi.ng/geom-arc": "^0.1.2", + "@thi.ng/geom-clip": "^0.0.4", + "@thi.ng/geom-closest-point": "^0.1.2", + "@thi.ng/geom-hull": "^0.0.4", + "@thi.ng/geom-isec": "^0.1.2", + "@thi.ng/geom-poly-utils": "^0.1.2", + "@thi.ng/geom-resample": "^0.1.2", + "@thi.ng/geom-splines": "^0.1.2", + "@thi.ng/geom-subdiv-curve": "^0.1.2", + "@thi.ng/geom-tessellate": "^0.1.2", "@thi.ng/hiccup": "^3.0.3", - "@thi.ng/hiccup-svg": "^3.1.3", + "@thi.ng/hiccup-svg": "^3.1.4", "@thi.ng/math": "^1.1.0", - "@thi.ng/matrices": "^0.1.4", - "@thi.ng/random": "^1.0.2", - "@thi.ng/transducers": "^4.0.1", - "@thi.ng/vectors": "^2.2.1" + "@thi.ng/matrices": "^0.1.5", + "@thi.ng/random": "^1.1.0", + "@thi.ng/transducers": "^5.0.0", + "@thi.ng/vectors": "^2.3.0" }, "keywords": [ "2D", @@ -72,4 +72,4 @@ "access": "public" }, "sideEffects": false -} \ No newline at end of file +} diff --git a/packages/hdom-canvas/CHANGELOG.md b/packages/hdom-canvas/CHANGELOG.md index d7eccbb705..ab7da76bf1 100644 --- a/packages/hdom-canvas/CHANGELOG.md +++ b/packages/hdom-canvas/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.1.4](https://github.com/thi-ng/umbrella/compare/@thi.ng/hdom-canvas@1.1.3...@thi.ng/hdom-canvas@1.1.4) (2019-02-15) + +**Note:** Version bump only for package @thi.ng/hdom-canvas + + + + + ## [1.1.3](https://github.com/thi-ng/umbrella/compare/@thi.ng/hdom-canvas@1.1.2...@thi.ng/hdom-canvas@1.1.3) (2019-02-10) **Note:** Version bump only for package @thi.ng/hdom-canvas diff --git a/packages/hdom-canvas/package.json b/packages/hdom-canvas/package.json index 9f9eee81b5..636eaf3d6c 100644 --- a/packages/hdom-canvas/package.json +++ b/packages/hdom-canvas/package.json @@ -1,6 +1,6 @@ { "name": "@thi.ng/hdom-canvas", - "version": "1.1.3", + "version": "1.1.4", "description": "Declarative canvas scenegraph & visualization for @thi.ng/hdom", "module": "./index.js", "main": "./lib/index.js", @@ -34,7 +34,7 @@ "dependencies": { "@thi.ng/api": "^5.0.2", "@thi.ng/checks": "^2.1.0", - "@thi.ng/color": "^0.1.4", + "@thi.ng/color": "^0.1.5", "@thi.ng/diff": "^3.0.2", "@thi.ng/hdom": "^7.1.0" }, diff --git a/packages/hdom-components/CHANGELOG.md b/packages/hdom-components/CHANGELOG.md index cfaca1faf4..d98097f8be 100644 --- a/packages/hdom-components/CHANGELOG.md +++ b/packages/hdom-components/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. +## [3.0.5](https://github.com/thi-ng/umbrella/compare/@thi.ng/hdom-components@3.0.4...@thi.ng/hdom-components@3.0.5) (2019-02-15) + +**Note:** Version bump only for package @thi.ng/hdom-components + + + + + ## [3.0.4](https://github.com/thi-ng/umbrella/compare/@thi.ng/hdom-components@3.0.3...@thi.ng/hdom-components@3.0.4) (2019-02-10) **Note:** Version bump only for package @thi.ng/hdom-components diff --git a/packages/hdom-components/package.json b/packages/hdom-components/package.json index 58e302054f..33115a9344 100644 --- a/packages/hdom-components/package.json +++ b/packages/hdom-components/package.json @@ -1,6 +1,6 @@ { "name": "@thi.ng/hdom-components", - "version": "3.0.4", + "version": "3.0.5", "description": "Raw, skinnable UI & SVG components for @thi.ng/hdom", "module": "./index.js", "main": "./lib/index.js", @@ -35,8 +35,8 @@ "@thi.ng/api": "^5.0.2", "@thi.ng/checks": "^2.1.0", "@thi.ng/math": "^1.1.0", - "@thi.ng/transducers": "^4.0.1", - "@thi.ng/transducers-stats": "^1.0.4", + "@thi.ng/transducers": "^5.0.0", + "@thi.ng/transducers-stats": "^1.0.5", "@types/webgl2": "^0.0.4" }, "keywords": [ diff --git a/packages/heaps/CHANGELOG.md b/packages/heaps/CHANGELOG.md index 0ff3012f42..1fbae5eec4 100644 --- a/packages/heaps/CHANGELOG.md +++ b/packages/heaps/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.3](https://github.com/thi-ng/umbrella/compare/@thi.ng/heaps@1.0.2...@thi.ng/heaps@1.0.3) (2019-02-15) + +**Note:** Version bump only for package @thi.ng/heaps + + + + + ## [1.0.2](https://github.com/thi-ng/umbrella/compare/@thi.ng/heaps@1.0.1...@thi.ng/heaps@1.0.2) (2019-02-05) **Note:** Version bump only for package @thi.ng/heaps diff --git a/packages/heaps/package.json b/packages/heaps/package.json index 204ab78851..584a82cd06 100644 --- a/packages/heaps/package.json +++ b/packages/heaps/package.json @@ -1,6 +1,6 @@ { "name": "@thi.ng/heaps", - "version": "1.0.2", + "version": "1.0.3", "description": "Generic binary heap & d-ary heap implementations with customizable ordering", "module": "./index.js", "main": "./lib/index.js", diff --git a/packages/hiccup-carbon-icons/CHANGELOG.md b/packages/hiccup-carbon-icons/CHANGELOG.md index 4301a1838d..09c6709c57 100644 --- a/packages/hiccup-carbon-icons/CHANGELOG.md +++ b/packages/hiccup-carbon-icons/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.4](https://github.com/thi-ng/umbrella/compare/@thi.ng/hiccup-carbon-icons@1.0.3...@thi.ng/hiccup-carbon-icons@1.0.4) (2019-02-15) + +**Note:** Version bump only for package @thi.ng/hiccup-carbon-icons + + + + + ## [1.0.3](https://github.com/thi-ng/umbrella/compare/@thi.ng/hiccup-carbon-icons@1.0.2...@thi.ng/hiccup-carbon-icons@1.0.3) (2019-02-10) **Note:** Version bump only for package @thi.ng/hiccup-carbon-icons diff --git a/packages/hiccup-carbon-icons/package.json b/packages/hiccup-carbon-icons/package.json index ede2207804..cb34fcc1f0 100644 --- a/packages/hiccup-carbon-icons/package.json +++ b/packages/hiccup-carbon-icons/package.json @@ -1,6 +1,6 @@ { "name": "@thi.ng/hiccup-carbon-icons", - "version": "1.0.3", + "version": "1.0.4", "description": "Full set of IBM's Carbon icons in hiccup format", "module": "./index.js", "main": "./lib/index.js", @@ -48,4 +48,4 @@ "access": "public" }, "sideEffects": false -} \ No newline at end of file +} diff --git a/packages/hiccup-css/CHANGELOG.md b/packages/hiccup-css/CHANGELOG.md index 551b468c4b..2d97e4b91a 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. +## [1.0.5](https://github.com/thi-ng/umbrella/compare/@thi.ng/hiccup-css@1.0.4...@thi.ng/hiccup-css@1.0.5) (2019-02-15) + +**Note:** Version bump only for package @thi.ng/hiccup-css + + + + + ## [1.0.4](https://github.com/thi-ng/umbrella/compare/@thi.ng/hiccup-css@1.0.3...@thi.ng/hiccup-css@1.0.4) (2019-02-10) **Note:** Version bump only for package @thi.ng/hiccup-css diff --git a/packages/hiccup-css/package.json b/packages/hiccup-css/package.json index 5081310e50..87c9ad8658 100644 --- a/packages/hiccup-css/package.json +++ b/packages/hiccup-css/package.json @@ -1,6 +1,6 @@ { "name": "@thi.ng/hiccup-css", - "version": "1.0.4", + "version": "1.0.5", "description": "CSS from nested JS data structures", "module": "./index.js", "main": "./lib/index.js", @@ -35,7 +35,7 @@ "@thi.ng/api": "^5.0.2", "@thi.ng/checks": "^2.1.0", "@thi.ng/errors": "^1.0.2", - "@thi.ng/transducers": "^4.0.1" + "@thi.ng/transducers": "^5.0.0" }, "keywords": [ "clojure", diff --git a/packages/hiccup-markdown/CHANGELOG.md b/packages/hiccup-markdown/CHANGELOG.md index 3c4afd9254..e9929076ab 100644 --- a/packages/hiccup-markdown/CHANGELOG.md +++ b/packages/hiccup-markdown/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.5](https://github.com/thi-ng/umbrella/compare/@thi.ng/hiccup-markdown@1.0.4...@thi.ng/hiccup-markdown@1.0.5) (2019-02-15) + +**Note:** Version bump only for package @thi.ng/hiccup-markdown + + + + + ## [1.0.4](https://github.com/thi-ng/umbrella/compare/@thi.ng/hiccup-markdown@1.0.3...@thi.ng/hiccup-markdown@1.0.4) (2019-02-10) **Note:** Version bump only for package @thi.ng/hiccup-markdown diff --git a/packages/hiccup-markdown/package.json b/packages/hiccup-markdown/package.json index 3111c24737..a0a02c6a36 100644 --- a/packages/hiccup-markdown/package.json +++ b/packages/hiccup-markdown/package.json @@ -1,6 +1,6 @@ { "name": "@thi.ng/hiccup-markdown", - "version": "1.0.4", + "version": "1.0.5", "description": "Markdown serialization of hiccup DOM trees", "module": "./index.js", "main": "./lib/index.js", @@ -32,14 +32,14 @@ "typescript": "^3.2.2" }, "dependencies": { - "@thi.ng/arrays": "^0.0.1", + "@thi.ng/arrays": "^0.1.0", "@thi.ng/checks": "^2.1.0", "@thi.ng/defmulti": "^1.0.2", "@thi.ng/errors": "^1.0.2", - "@thi.ng/fsm": "^1.0.4", + "@thi.ng/fsm": "^2.0.0", "@thi.ng/hiccup": "^3.0.3", "@thi.ng/strings": "^1.0.3", - "@thi.ng/transducers": "^4.0.1" + "@thi.ng/transducers": "^5.0.0" }, "keywords": [ "ES6", @@ -57,4 +57,4 @@ "access": "public" }, "sideEffects": false -} \ No newline at end of file +} diff --git a/packages/hiccup-svg/CHANGELOG.md b/packages/hiccup-svg/CHANGELOG.md index 804c6dd641..5e385688c3 100644 --- a/packages/hiccup-svg/CHANGELOG.md +++ b/packages/hiccup-svg/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. +## [3.1.4](https://github.com/thi-ng/umbrella/compare/@thi.ng/hiccup-svg@3.1.3...@thi.ng/hiccup-svg@3.1.4) (2019-02-15) + +**Note:** Version bump only for package @thi.ng/hiccup-svg + + + + + ## [3.1.3](https://github.com/thi-ng/umbrella/compare/@thi.ng/hiccup-svg@3.1.2...@thi.ng/hiccup-svg@3.1.3) (2019-02-10) **Note:** Version bump only for package @thi.ng/hiccup-svg diff --git a/packages/hiccup-svg/package.json b/packages/hiccup-svg/package.json index 2861239109..afd921b47a 100644 --- a/packages/hiccup-svg/package.json +++ b/packages/hiccup-svg/package.json @@ -1,6 +1,6 @@ { "name": "@thi.ng/hiccup-svg", - "version": "3.1.3", + "version": "3.1.4", "description": "SVG element functions for @thi.ng/hiccup & @thi.ng/hdom", "module": "./index.js", "main": "./lib/index.js", @@ -33,7 +33,7 @@ }, "dependencies": { "@thi.ng/checks": "^2.1.0", - "@thi.ng/color": "^0.1.4", + "@thi.ng/color": "^0.1.5", "@thi.ng/hiccup": "^3.0.3" }, "keywords": [ diff --git a/packages/iges/CHANGELOG.md b/packages/iges/CHANGELOG.md index 4752f6e8cb..55721e6634 100644 --- a/packages/iges/CHANGELOG.md +++ b/packages/iges/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.5](https://github.com/thi-ng/umbrella/compare/@thi.ng/iges@1.0.4...@thi.ng/iges@1.0.5) (2019-02-15) + +**Note:** Version bump only for package @thi.ng/iges + + + + + ## [1.0.4](https://github.com/thi-ng/umbrella/compare/@thi.ng/iges@1.0.3...@thi.ng/iges@1.0.4) (2019-02-10) **Note:** Version bump only for package @thi.ng/iges diff --git a/packages/iges/package.json b/packages/iges/package.json index b05a3ede2b..43ad07f5e8 100644 --- a/packages/iges/package.json +++ b/packages/iges/package.json @@ -1,6 +1,6 @@ { "name": "@thi.ng/iges", - "version": "1.0.4", + "version": "1.0.5", "description": "IGES 5.3 serializer for (currently only) polygonal geometry, both open & closed", "module": "./index.js", "main": "./lib/index.js", @@ -35,7 +35,7 @@ "@thi.ng/api": "^5.0.2", "@thi.ng/defmulti": "^1.0.2", "@thi.ng/strings": "^1.0.3", - "@thi.ng/transducers": "^4.0.1" + "@thi.ng/transducers": "^5.0.0" }, "keywords": [ "CAD", diff --git a/packages/iterators/CHANGELOG.md b/packages/iterators/CHANGELOG.md index bc7f3e5d13..ddd3849644 100644 --- a/packages/iterators/CHANGELOG.md +++ b/packages/iterators/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. +## [5.0.5](https://github.com/thi-ng/umbrella/compare/@thi.ng/iterators@5.0.4...@thi.ng/iterators@5.0.5) (2019-02-15) + +**Note:** Version bump only for package @thi.ng/iterators + + + + + ## [5.0.4](https://github.com/thi-ng/umbrella/compare/@thi.ng/iterators@5.0.3...@thi.ng/iterators@5.0.4) (2019-02-10) **Note:** Version bump only for package @thi.ng/iterators diff --git a/packages/iterators/package.json b/packages/iterators/package.json index 70df5ceff0..97a33f0b44 100644 --- a/packages/iterators/package.json +++ b/packages/iterators/package.json @@ -1,6 +1,6 @@ { "name": "@thi.ng/iterators", - "version": "5.0.4", + "version": "5.0.5", "description": "clojure.core inspired, composable ES6 iterators & generators", "module": "./index.js", "main": "./lib/index.js", @@ -33,7 +33,7 @@ }, "dependencies": { "@thi.ng/api": "^5.0.2", - "@thi.ng/dcons": "^2.0.4", + "@thi.ng/dcons": "^2.0.5", "@thi.ng/errors": "^1.0.2" }, "keywords": [ diff --git a/packages/malloc/CHANGELOG.md b/packages/malloc/CHANGELOG.md index ad90b061df..2c30a11378 100644 --- a/packages/malloc/CHANGELOG.md +++ b/packages/malloc/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.0.2](https://github.com/thi-ng/umbrella/compare/@thi.ng/malloc@2.0.1...@thi.ng/malloc@2.0.2) (2019-02-15) + +**Note:** Version bump only for package @thi.ng/malloc + + + + + ## [2.0.1](https://github.com/thi-ng/umbrella/compare/@thi.ng/malloc@2.0.0...@thi.ng/malloc@2.0.1) (2019-02-10) **Note:** Version bump only for package @thi.ng/malloc diff --git a/packages/malloc/package.json b/packages/malloc/package.json index a9f24eb7b6..b83373a766 100644 --- a/packages/malloc/package.json +++ b/packages/malloc/package.json @@ -1,6 +1,6 @@ { "name": "@thi.ng/malloc", - "version": "2.0.1", + "version": "2.0.2", "description": "ArrayBuffer based malloc() impl for hybrid JS/WASM use cases, based on thi.ng/tinyalloc", "module": "./index.js", "main": "./lib/index.js", diff --git a/packages/matrices/CHANGELOG.md b/packages/matrices/CHANGELOG.md index 7fd59464c4..dd4041c2ab 100644 --- a/packages/matrices/CHANGELOG.md +++ b/packages/matrices/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.5](https://github.com/thi-ng/umbrella/compare/@thi.ng/matrices@0.1.4...@thi.ng/matrices@0.1.5) (2019-02-15) + +**Note:** Version bump only for package @thi.ng/matrices + + + + + ## [0.1.4](https://github.com/thi-ng/umbrella/compare/@thi.ng/matrices@0.1.3...@thi.ng/matrices@0.1.4) (2019-02-10) **Note:** Version bump only for package @thi.ng/matrices diff --git a/packages/matrices/package.json b/packages/matrices/package.json index c8b25092bb..7a199f3b26 100644 --- a/packages/matrices/package.json +++ b/packages/matrices/package.json @@ -1,6 +1,6 @@ { "name": "@thi.ng/matrices", - "version": "0.1.4", + "version": "0.1.5", "description": "Matrix & quaternion operations for 2D/3D geometry processing", "module": "./index.js", "main": "./lib/index.js", @@ -35,7 +35,7 @@ "@thi.ng/api": "^5.0.2", "@thi.ng/checks": "^2.1.0", "@thi.ng/math": "^1.1.0", - "@thi.ng/vectors": "^2.2.1" + "@thi.ng/vectors": "^2.3.0" }, "keywords": [ "2D", diff --git a/packages/pointfree-lang/CHANGELOG.md b/packages/pointfree-lang/CHANGELOG.md index 3d116e8d2b..c92c3c7cb5 100644 --- a/packages/pointfree-lang/CHANGELOG.md +++ b/packages/pointfree-lang/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.4](https://github.com/thi-ng/umbrella/compare/@thi.ng/pointfree-lang@1.0.3...@thi.ng/pointfree-lang@1.0.4) (2019-02-15) + +**Note:** Version bump only for package @thi.ng/pointfree-lang + + + + + ## [1.0.3](https://github.com/thi-ng/umbrella/compare/@thi.ng/pointfree-lang@1.0.2...@thi.ng/pointfree-lang@1.0.3) (2019-02-10) **Note:** Version bump only for package @thi.ng/pointfree-lang diff --git a/packages/pointfree-lang/package.json b/packages/pointfree-lang/package.json index 3a0d0c7963..5050553a92 100644 --- a/packages/pointfree-lang/package.json +++ b/packages/pointfree-lang/package.json @@ -1,6 +1,6 @@ { "name": "@thi.ng/pointfree-lang", - "version": "1.0.3", + "version": "1.0.4", "description": "Forth style syntax layer/compiler for the @thi.ng/pointfree DSL", "module": "./index.js", "main": "./lib/index.js", @@ -36,7 +36,7 @@ "dependencies": { "@thi.ng/api": "^5.0.2", "@thi.ng/errors": "^1.0.2", - "@thi.ng/pointfree": "^1.0.3" + "@thi.ng/pointfree": "^1.0.4" }, "keywords": [ "concatenative", diff --git a/packages/pointfree/CHANGELOG.md b/packages/pointfree/CHANGELOG.md index 4497dbafd1..9ed528f2b0 100644 --- a/packages/pointfree/CHANGELOG.md +++ b/packages/pointfree/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.4](https://github.com/thi-ng/umbrella/compare/@thi.ng/pointfree@1.0.3...@thi.ng/pointfree@1.0.4) (2019-02-15) + +**Note:** Version bump only for package @thi.ng/pointfree + + + + + ## [1.0.3](https://github.com/thi-ng/umbrella/compare/@thi.ng/pointfree@1.0.2...@thi.ng/pointfree@1.0.3) (2019-02-10) **Note:** Version bump only for package @thi.ng/pointfree diff --git a/packages/pointfree/package.json b/packages/pointfree/package.json index 3b6ae4dab8..1724c3a32d 100644 --- a/packages/pointfree/package.json +++ b/packages/pointfree/package.json @@ -1,6 +1,6 @@ { "name": "@thi.ng/pointfree", - "version": "1.0.3", + "version": "1.0.4", "description": "Pointfree functional composition / Forth style stack execution engine", "module": "./index.js", "main": "./lib/index.js", @@ -34,7 +34,7 @@ "dependencies": { "@thi.ng/api": "^5.0.2", "@thi.ng/checks": "^2.1.0", - "@thi.ng/compose": "^1.0.2", + "@thi.ng/compose": "^1.1.0", "@thi.ng/equiv": "^1.0.2", "@thi.ng/errors": "^1.0.2" }, diff --git a/packages/poisson/CHANGELOG.md b/packages/poisson/CHANGELOG.md index 5abb8f98f4..c42e51cda9 100644 --- a/packages/poisson/CHANGELOG.md +++ b/packages/poisson/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.2](https://github.com/thi-ng/umbrella/compare/@thi.ng/poisson@0.2.1...@thi.ng/poisson@0.2.2) (2019-02-15) + +**Note:** Version bump only for package @thi.ng/poisson + + + + + ## [0.2.1](https://github.com/thi-ng/umbrella/compare/@thi.ng/poisson@0.2.0...@thi.ng/poisson@0.2.1) (2019-02-10) **Note:** Version bump only for package @thi.ng/poisson diff --git a/packages/poisson/package.json b/packages/poisson/package.json index 5f3b69be2c..3d8efe79f8 100644 --- a/packages/poisson/package.json +++ b/packages/poisson/package.json @@ -1,6 +1,6 @@ { "name": "@thi.ng/poisson", - "version": "0.2.1", + "version": "0.2.2", "description": "nD Poisson-disc sampling w/ support for spatial density functions and custom PRNGs", "module": "./index.js", "main": "./lib/index.js", @@ -33,9 +33,9 @@ }, "dependencies": { "@thi.ng/checks": "^2.1.0", - "@thi.ng/geom-api": "^0.1.1", - "@thi.ng/random": "^1.0.2", - "@thi.ng/vectors": "^2.2.1" + "@thi.ng/geom-api": "^0.1.2", + "@thi.ng/random": "^1.1.0", + "@thi.ng/vectors": "^2.3.0" }, "keywords": [ "2d", diff --git a/packages/random/CHANGELOG.md b/packages/random/CHANGELOG.md index 8048a3412f..a45bc81e55 100644 --- a/packages/random/CHANGELOG.md +++ b/packages/random/CHANGELOG.md @@ -3,6 +3,22 @@ All notable changes to this project will be documented in this file. See [Conventional Commits](https://conventionalcommits.org) for commit guidelines. +# [1.1.0](https://github.com/thi-ng/umbrella/compare/@thi.ng/random@1.0.2...@thi.ng/random@1.1.0) (2019-02-15) + + +### Bug Fixes + +* **random:** add opt scale arg to IRandom.float() ([5a7e448](https://github.com/thi-ng/umbrella/commit/5a7e448)) + + +### Features + +* **random:** add randomID() & weightedRandom() ([f719724](https://github.com/thi-ng/umbrella/commit/f719724)) + + + + + ## [1.0.2](https://github.com/thi-ng/umbrella/compare/@thi.ng/random@1.0.1...@thi.ng/random@1.0.2) (2019-02-05) **Note:** Version bump only for package @thi.ng/random diff --git a/packages/random/package.json b/packages/random/package.json index d14851532e..441e05ede0 100644 --- a/packages/random/package.json +++ b/packages/random/package.json @@ -1,6 +1,6 @@ { "name": "@thi.ng/random", - "version": "1.0.2", + "version": "1.1.0", "description": "Pseudo-random number generators w/ unified API", "module": "./index.js", "main": "./lib/index.js", diff --git a/packages/range-coder/CHANGELOG.md b/packages/range-coder/CHANGELOG.md index ccd04e9b35..8a8560be2e 100644 --- a/packages/range-coder/CHANGELOG.md +++ b/packages/range-coder/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.5](https://github.com/thi-ng/umbrella/compare/@thi.ng/range-coder@1.0.4...@thi.ng/range-coder@1.0.5) (2019-02-15) + +**Note:** Version bump only for package @thi.ng/range-coder + + + + + ## [1.0.4](https://github.com/thi-ng/umbrella/compare/@thi.ng/range-coder@1.0.3...@thi.ng/range-coder@1.0.4) (2019-02-10) **Note:** Version bump only for package @thi.ng/range-coder diff --git a/packages/range-coder/package.json b/packages/range-coder/package.json index 1a10bdc567..73684596d8 100644 --- a/packages/range-coder/package.json +++ b/packages/range-coder/package.json @@ -1,6 +1,6 @@ { "name": "@thi.ng/range-coder", - "version": "1.0.4", + "version": "1.0.5", "description": "Binary data range encoder / decoder", "module": "./index.js", "main": "./lib/index.js", @@ -24,7 +24,7 @@ "pub": "yarn build && yarn publish --access public" }, "devDependencies": { - "@thi.ng/transducers": "^4.0.1", + "@thi.ng/transducers": "^5.0.0", "@types/mocha": "^5.2.5", "@types/node": "^10.12.15", "mocha": "^5.2.0", diff --git a/packages/rstream-csp/CHANGELOG.md b/packages/rstream-csp/CHANGELOG.md index 3d0037ae37..a154cba34c 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. +## [1.0.5](https://github.com/thi-ng/umbrella/compare/@thi.ng/rstream-csp@1.0.4...@thi.ng/rstream-csp@1.0.5) (2019-02-15) + +**Note:** Version bump only for package @thi.ng/rstream-csp + + + + + ## [1.0.4](https://github.com/thi-ng/umbrella/compare/@thi.ng/rstream-csp@1.0.3...@thi.ng/rstream-csp@1.0.4) (2019-02-10) **Note:** Version bump only for package @thi.ng/rstream-csp diff --git a/packages/rstream-csp/package.json b/packages/rstream-csp/package.json index 6f2c918e2d..86de0aa266 100644 --- a/packages/rstream-csp/package.json +++ b/packages/rstream-csp/package.json @@ -1,6 +1,6 @@ { "name": "@thi.ng/rstream-csp", - "version": "1.0.4", + "version": "1.0.5", "description": "@thi.ng/csp bridge module for @thi.ng/rstream", "module": "./index.js", "main": "./lib/index.js", @@ -32,8 +32,8 @@ "typescript": "^3.2.2" }, "dependencies": { - "@thi.ng/csp": "^1.0.4", - "@thi.ng/rstream": "^2.0.4" + "@thi.ng/csp": "^1.0.5", + "@thi.ng/rstream": "^2.0.5" }, "keywords": [ "bridge", diff --git a/packages/rstream-dot/CHANGELOG.md b/packages/rstream-dot/CHANGELOG.md index 4971e41921..f019c50fb1 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. +## [1.0.5](https://github.com/thi-ng/umbrella/compare/@thi.ng/rstream-dot@1.0.4...@thi.ng/rstream-dot@1.0.5) (2019-02-15) + +**Note:** Version bump only for package @thi.ng/rstream-dot + + + + + ## [1.0.4](https://github.com/thi-ng/umbrella/compare/@thi.ng/rstream-dot@1.0.3...@thi.ng/rstream-dot@1.0.4) (2019-02-10) **Note:** Version bump only for package @thi.ng/rstream-dot diff --git a/packages/rstream-dot/package.json b/packages/rstream-dot/package.json index c30bf976c4..a96d83d847 100644 --- a/packages/rstream-dot/package.json +++ b/packages/rstream-dot/package.json @@ -1,6 +1,6 @@ { "name": "@thi.ng/rstream-dot", - "version": "1.0.4", + "version": "1.0.5", "description": "Graphviz DOT conversion of @thi.ng/rstream dataflow graph topologies", "module": "./index.js", "main": "./lib/index.js", @@ -32,7 +32,7 @@ "typescript": "^3.2.2" }, "dependencies": { - "@thi.ng/rstream": "^2.0.4" + "@thi.ng/rstream": "^2.0.5" }, "keywords": [ "conversion", diff --git a/packages/rstream-gestures/CHANGELOG.md b/packages/rstream-gestures/CHANGELOG.md index 953aad7e3e..11a8b23dc6 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. +## [1.0.5](https://github.com/thi-ng/umbrella/compare/@thi.ng/rstream-gestures@1.0.4...@thi.ng/rstream-gestures@1.0.5) (2019-02-15) + +**Note:** Version bump only for package @thi.ng/rstream-gestures + + + + + ## [1.0.4](https://github.com/thi-ng/umbrella/compare/@thi.ng/rstream-gestures@1.0.3...@thi.ng/rstream-gestures@1.0.4) (2019-02-10) **Note:** Version bump only for package @thi.ng/rstream-gestures diff --git a/packages/rstream-gestures/package.json b/packages/rstream-gestures/package.json index 58cfcd7afd..6bd105df37 100644 --- a/packages/rstream-gestures/package.json +++ b/packages/rstream-gestures/package.json @@ -1,6 +1,6 @@ { "name": "@thi.ng/rstream-gestures", - "version": "1.0.4", + "version": "1.0.5", "description": "Unified mouse, mouse wheel & single-touch event stream abstraction", "module": "./index.js", "main": "./lib/index.js", @@ -33,8 +33,8 @@ }, "dependencies": { "@thi.ng/api": "^5.0.2", - "@thi.ng/rstream": "^2.0.4", - "@thi.ng/transducers": "^4.0.1" + "@thi.ng/rstream": "^2.0.5", + "@thi.ng/transducers": "^5.0.0" }, "keywords": [ "dataflow", diff --git a/packages/rstream-graph/CHANGELOG.md b/packages/rstream-graph/CHANGELOG.md index fb45f5c744..903f337850 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. +## [3.0.5](https://github.com/thi-ng/umbrella/compare/@thi.ng/rstream-graph@3.0.4...@thi.ng/rstream-graph@3.0.5) (2019-02-15) + +**Note:** Version bump only for package @thi.ng/rstream-graph + + + + + ## [3.0.4](https://github.com/thi-ng/umbrella/compare/@thi.ng/rstream-graph@3.0.3...@thi.ng/rstream-graph@3.0.4) (2019-02-10) **Note:** Version bump only for package @thi.ng/rstream-graph diff --git a/packages/rstream-graph/package.json b/packages/rstream-graph/package.json index 028d3dce2b..128147f2ea 100644 --- a/packages/rstream-graph/package.json +++ b/packages/rstream-graph/package.json @@ -1,6 +1,6 @@ { "name": "@thi.ng/rstream-graph", - "version": "3.0.4", + "version": "3.0.5", "description": "Declarative dataflow graph construction for @thi.ng/rstream", "module": "./index.js", "main": "./lib/index.js", @@ -37,8 +37,8 @@ "@thi.ng/errors": "^1.0.2", "@thi.ng/paths": "^2.0.3", "@thi.ng/resolve-map": "^4.0.3", - "@thi.ng/rstream": "^2.0.4", - "@thi.ng/transducers": "^4.0.1" + "@thi.ng/rstream": "^2.0.5", + "@thi.ng/transducers": "^5.0.0" }, "keywords": [ "compute", diff --git a/packages/rstream-log/CHANGELOG.md b/packages/rstream-log/CHANGELOG.md index 181f5ce841..5b93fc1a71 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. +## [2.0.5](https://github.com/thi-ng/umbrella/compare/@thi.ng/rstream-log@2.0.4...@thi.ng/rstream-log@2.0.5) (2019-02-15) + +**Note:** Version bump only for package @thi.ng/rstream-log + + + + + ## [2.0.4](https://github.com/thi-ng/umbrella/compare/@thi.ng/rstream-log@2.0.3...@thi.ng/rstream-log@2.0.4) (2019-02-10) **Note:** Version bump only for package @thi.ng/rstream-log diff --git a/packages/rstream-log/package.json b/packages/rstream-log/package.json index fcd51e4bd5..2c1beec213 100644 --- a/packages/rstream-log/package.json +++ b/packages/rstream-log/package.json @@ -1,6 +1,6 @@ { "name": "@thi.ng/rstream-log", - "version": "2.0.4", + "version": "2.0.5", "description": "Structured, multilevel & hierarchical loggers based on @thi.ng/rstream", "module": "./index.js", "main": "./lib/index.js", @@ -35,8 +35,8 @@ "@thi.ng/api": "^5.0.2", "@thi.ng/checks": "^2.1.0", "@thi.ng/errors": "^1.0.2", - "@thi.ng/rstream": "^2.0.4", - "@thi.ng/transducers": "^4.0.1" + "@thi.ng/rstream": "^2.0.5", + "@thi.ng/transducers": "^5.0.0" }, "keywords": [ "ES6", diff --git a/packages/rstream-query/CHANGELOG.md b/packages/rstream-query/CHANGELOG.md index f569c6ab8d..835685d87f 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. +## [1.0.5](https://github.com/thi-ng/umbrella/compare/@thi.ng/rstream-query@1.0.4...@thi.ng/rstream-query@1.0.5) (2019-02-15) + +**Note:** Version bump only for package @thi.ng/rstream-query + + + + + ## [1.0.4](https://github.com/thi-ng/umbrella/compare/@thi.ng/rstream-query@1.0.3...@thi.ng/rstream-query@1.0.4) (2019-02-10) **Note:** Version bump only for package @thi.ng/rstream-query diff --git a/packages/rstream-query/package.json b/packages/rstream-query/package.json index f41854491a..1b38446570 100644 --- a/packages/rstream-query/package.json +++ b/packages/rstream-query/package.json @@ -1,6 +1,6 @@ { "name": "@thi.ng/rstream-query", - "version": "1.0.4", + "version": "1.0.5", "description": "@thi.ng/rstream based triple store & reactive query engine", "module": "./index.js", "main": "./lib/index.js", @@ -33,13 +33,13 @@ }, "dependencies": { "@thi.ng/api": "^5.0.2", - "@thi.ng/associative": "^1.0.4", + "@thi.ng/associative": "^1.0.5", "@thi.ng/checks": "^2.1.0", "@thi.ng/equiv": "^1.0.2", "@thi.ng/errors": "^1.0.2", - "@thi.ng/rstream": "^2.0.4", - "@thi.ng/rstream-dot": "^1.0.4", - "@thi.ng/transducers": "^4.0.1" + "@thi.ng/rstream": "^2.0.5", + "@thi.ng/rstream-dot": "^1.0.5", + "@thi.ng/transducers": "^5.0.0" }, "keywords": [ "dataflow", diff --git a/packages/rstream/CHANGELOG.md b/packages/rstream/CHANGELOG.md index 96f32eaaaf..e6340b3bfb 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. +## [2.0.5](https://github.com/thi-ng/umbrella/compare/@thi.ng/rstream@2.0.4...@thi.ng/rstream@2.0.5) (2019-02-15) + +**Note:** Version bump only for package @thi.ng/rstream + + + + + ## [2.0.4](https://github.com/thi-ng/umbrella/compare/@thi.ng/rstream@2.0.3...@thi.ng/rstream@2.0.4) (2019-02-10) **Note:** Version bump only for package @thi.ng/rstream diff --git a/packages/rstream/package.json b/packages/rstream/package.json index a0dff60f02..8385322cc8 100644 --- a/packages/rstream/package.json +++ b/packages/rstream/package.json @@ -1,6 +1,6 @@ { "name": "@thi.ng/rstream", - "version": "2.0.4", + "version": "2.0.5", "description": "Reactive multi-tap streams, dataflow & transformation pipeline constructs", "module": "./index.js", "main": "./lib/index.js", @@ -33,12 +33,12 @@ }, "dependencies": { "@thi.ng/api": "^5.0.2", - "@thi.ng/associative": "^1.0.4", + "@thi.ng/associative": "^1.0.5", "@thi.ng/atom": "^2.0.3", "@thi.ng/checks": "^2.1.0", "@thi.ng/errors": "^1.0.2", "@thi.ng/paths": "^2.0.3", - "@thi.ng/transducers": "^4.0.1" + "@thi.ng/transducers": "^5.0.0" }, "keywords": [ "datastructure", diff --git a/packages/sax/CHANGELOG.md b/packages/sax/CHANGELOG.md index 214e0bc157..2e3f1f0a16 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. +## [1.0.5](https://github.com/thi-ng/umbrella/compare/@thi.ng/sax@1.0.4...@thi.ng/sax@1.0.5) (2019-02-15) + +**Note:** Version bump only for package @thi.ng/sax + + + + + ## [1.0.4](https://github.com/thi-ng/umbrella/compare/@thi.ng/sax@1.0.3...@thi.ng/sax@1.0.4) (2019-02-10) **Note:** Version bump only for package @thi.ng/sax diff --git a/packages/sax/package.json b/packages/sax/package.json index d4b7873e7f..c2af85f289 100644 --- a/packages/sax/package.json +++ b/packages/sax/package.json @@ -1,6 +1,6 @@ { "name": "@thi.ng/sax", - "version": "1.0.4", + "version": "1.0.5", "description": "Transducer-based, SAX-like, non-validating, speedy & tiny XML parser", "module": "./index.js", "main": "./lib/index.js", @@ -33,8 +33,8 @@ }, "dependencies": { "@thi.ng/api": "^5.0.2", - "@thi.ng/transducers": "^4.0.1", - "@thi.ng/transducers-fsm": "^1.0.4" + "@thi.ng/transducers": "^5.0.0", + "@thi.ng/transducers-fsm": "^1.0.5" }, "keywords": [ "ES6", diff --git a/packages/transducers-binary/CHANGELOG.md b/packages/transducers-binary/CHANGELOG.md index 79c48288f1..61d09a43bc 100644 --- a/packages/transducers-binary/CHANGELOG.md +++ b/packages/transducers-binary/CHANGELOG.md @@ -3,6 +3,22 @@ All notable changes to this project will be documented in this file. See [Conventional Commits](https://conventionalcommits.org) for commit guidelines. +# [0.2.0](https://github.com/thi-ng/umbrella/compare/@thi.ng/transducers-binary@0.1.1...@thi.ng/transducers-binary@0.2.0) (2019-02-15) + + +### Bug Fixes + +* **transducers-binary:** update juxt import ([77ed4c5](https://github.com/thi-ng/umbrella/commit/77ed4c5)) + + +### Features + +* **transducers-binary:** add utf8Length() ([7cf98ef](https://github.com/thi-ng/umbrella/commit/7cf98ef)) + + + + + ## [0.1.1](https://github.com/thi-ng/umbrella/compare/@thi.ng/transducers-binary@0.1.0...@thi.ng/transducers-binary@0.1.1) (2019-02-10) **Note:** Version bump only for package @thi.ng/transducers-binary diff --git a/packages/transducers-binary/package.json b/packages/transducers-binary/package.json index b70294751d..3d530a0ebe 100644 --- a/packages/transducers-binary/package.json +++ b/packages/transducers-binary/package.json @@ -1,6 +1,6 @@ { "name": "@thi.ng/transducers-binary", - "version": "0.1.1", + "version": "0.2.0", "description": "Binary data related transducers & reducers", "module": "./index.js", "main": "./lib/index.js", @@ -32,9 +32,9 @@ "typescript": "^3.2.2" }, "dependencies": { - "@thi.ng/compose": "^1.0.2", + "@thi.ng/compose": "^1.1.0", "@thi.ng/strings": "^1.0.3", - "@thi.ng/transducers": "^4.0.1" + "@thi.ng/transducers": "^5.0.0" }, "keywords": [ "base64", @@ -56,4 +56,4 @@ "access": "public" }, "sideEffects": false -} \ No newline at end of file +} diff --git a/packages/transducers-fsm/CHANGELOG.md b/packages/transducers-fsm/CHANGELOG.md index 98a4d8a0dd..7be60fe509 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. +## [1.0.5](https://github.com/thi-ng/umbrella/compare/@thi.ng/transducers-fsm@1.0.4...@thi.ng/transducers-fsm@1.0.5) (2019-02-15) + +**Note:** Version bump only for package @thi.ng/transducers-fsm + + + + + ## [1.0.4](https://github.com/thi-ng/umbrella/compare/@thi.ng/transducers-fsm@1.0.3...@thi.ng/transducers-fsm@1.0.4) (2019-02-10) **Note:** Version bump only for package @thi.ng/transducers-fsm diff --git a/packages/transducers-fsm/package.json b/packages/transducers-fsm/package.json index 5bf3d6ba55..e0537257e8 100644 --- a/packages/transducers-fsm/package.json +++ b/packages/transducers-fsm/package.json @@ -1,6 +1,6 @@ { "name": "@thi.ng/transducers-fsm", - "version": "1.0.4", + "version": "1.0.5", "description": "Transducer-based Finite State Machine transformer", "module": "./index.js", "main": "./lib/index.js", @@ -33,7 +33,7 @@ }, "dependencies": { "@thi.ng/api": "^5.0.2", - "@thi.ng/transducers": "^4.0.1" + "@thi.ng/transducers": "^5.0.0" }, "keywords": [ "ES6", diff --git a/packages/transducers-hdom/CHANGELOG.md b/packages/transducers-hdom/CHANGELOG.md index 6d4c29196b..d6f3eaad13 100644 --- a/packages/transducers-hdom/CHANGELOG.md +++ b/packages/transducers-hdom/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.0.5](https://github.com/thi-ng/umbrella/compare/@thi.ng/transducers-hdom@2.0.4...@thi.ng/transducers-hdom@2.0.5) (2019-02-15) + +**Note:** Version bump only for package @thi.ng/transducers-hdom + + + + + ## [2.0.4](https://github.com/thi-ng/umbrella/compare/@thi.ng/transducers-hdom@2.0.3...@thi.ng/transducers-hdom@2.0.4) (2019-02-10) **Note:** Version bump only for package @thi.ng/transducers-hdom diff --git a/packages/transducers-hdom/package.json b/packages/transducers-hdom/package.json index 4b748a510a..b6018fedb3 100644 --- a/packages/transducers-hdom/package.json +++ b/packages/transducers-hdom/package.json @@ -1,6 +1,6 @@ { "name": "@thi.ng/transducers-hdom", - "version": "2.0.4", + "version": "2.0.5", "description": "Transducer based UI updater for @thi.ng/hdom", "module": "./index.js", "main": "./lib/index.js", @@ -34,7 +34,7 @@ "dependencies": { "@thi.ng/hdom": "^7.1.0", "@thi.ng/hiccup": "^3.0.3", - "@thi.ng/transducers": "^4.0.1" + "@thi.ng/transducers": "^5.0.0" }, "keywords": [ "diff", diff --git a/packages/transducers-stats/CHANGELOG.md b/packages/transducers-stats/CHANGELOG.md index ec820d92d8..b8e276328b 100644 --- a/packages/transducers-stats/CHANGELOG.md +++ b/packages/transducers-stats/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.5](https://github.com/thi-ng/umbrella/compare/@thi.ng/transducers-stats@1.0.4...@thi.ng/transducers-stats@1.0.5) (2019-02-15) + +**Note:** Version bump only for package @thi.ng/transducers-stats + + + + + ## [1.0.4](https://github.com/thi-ng/umbrella/compare/@thi.ng/transducers-stats@1.0.3...@thi.ng/transducers-stats@1.0.4) (2019-02-10) **Note:** Version bump only for package @thi.ng/transducers-stats diff --git a/packages/transducers-stats/package.json b/packages/transducers-stats/package.json index 15b629d2d1..120a4488c6 100644 --- a/packages/transducers-stats/package.json +++ b/packages/transducers-stats/package.json @@ -1,6 +1,6 @@ { "name": "@thi.ng/transducers-stats", - "version": "1.0.4", + "version": "1.0.5", "description": "Transducers for statistical / technical analysis", "module": "./index.js", "main": "./lib/index.js", @@ -33,9 +33,9 @@ }, "dependencies": { "@thi.ng/checks": "^2.1.0", - "@thi.ng/dcons": "^2.0.4", + "@thi.ng/dcons": "^2.0.5", "@thi.ng/errors": "^1.0.2", - "@thi.ng/transducers": "^4.0.1" + "@thi.ng/transducers": "^5.0.0" }, "keywords": [ "ES6", diff --git a/packages/transducers/CHANGELOG.md b/packages/transducers/CHANGELOG.md index ac27efd5a3..d7927bcacc 100644 --- a/packages/transducers/CHANGELOG.md +++ b/packages/transducers/CHANGELOG.md @@ -3,6 +3,49 @@ All notable changes to this project will be documented in this file. See [Conventional Commits](https://conventionalcommits.org) for commit guidelines. +# [5.0.0](https://github.com/thi-ng/umbrella/compare/@thi.ng/transducers@4.0.1...@thi.ng/transducers@5.0.0) (2019-02-15) + + +### Code Refactoring + +* **transducers:** remove obsolete fns, update to use [@thi](https://github.com/thi).ng/arrays ([83cb816](https://github.com/thi-ng/umbrella/commit/83cb816)) +* **transducers:** remove obsolete randomID() & weightedRandom() ([4b0eec6](https://github.com/thi-ng/umbrella/commit/4b0eec6)) +* **transducers:** restructure, migrate / remove various functions ([05bf213](https://github.com/thi-ng/umbrella/commit/05bf213)) + + +### BREAKING CHANGES + +* **transducers:** migrate / remove various functions to other packages + +- constantly(), delay(), identity() => @thi.ng/compose +- randomID(), weightedRandom() => @thi.ng/random +- remove re-exports: + - even(), odd() (from @thi.ng/checks) + - juxt() (from @thi.ng/compose) +- remove obsolete hex() fn (use @thi.ng/strings fns instead) +* **transducers:** migrate randomID() & weightedRandom() to @thi.ng/random + +- update choices() iterator +* **transducers:** migrate various support fns to @thi.ng/arrays + +- remove/migrate functions: + - binarySearch() + - ensureArray() / ensureIterable() + - fuzzyMatch() + - peek() + - shuffleN() + - swizzler() +- add support for IRandom in: + - randomID() + - choices() + - weightedRandom() + - sample() +- update deps / readme + + + + + ## [4.0.1](https://github.com/thi-ng/umbrella/compare/@thi.ng/transducers@4.0.0...@thi.ng/transducers@4.0.1) (2019-02-10) **Note:** Version bump only for package @thi.ng/transducers diff --git a/packages/transducers/package.json b/packages/transducers/package.json index f9e0cf8412..65698c2f11 100644 --- a/packages/transducers/package.json +++ b/packages/transducers/package.json @@ -1,6 +1,6 @@ { "name": "@thi.ng/transducers", - "version": "4.0.1", + "version": "5.0.0", "description": "Lightweight transducer implementations for ES6 / TypeScript", "module": "./index.js", "main": "./lib/index.js", @@ -33,13 +33,13 @@ }, "dependencies": { "@thi.ng/api": "^5.0.2", - "@thi.ng/arrays": "^0.0.1", + "@thi.ng/arrays": "^0.1.0", "@thi.ng/checks": "^2.1.0", "@thi.ng/compare": "^1.0.2", - "@thi.ng/compose": "^1.0.2", + "@thi.ng/compose": "^1.1.0", "@thi.ng/equiv": "^1.0.2", "@thi.ng/errors": "^1.0.2", - "@thi.ng/random": "^1.0.2", + "@thi.ng/random": "^1.1.0", "@thi.ng/strings": "^1.0.3" }, "keywords": [ @@ -68,4 +68,4 @@ "access": "public" }, "sideEffects": false -} \ No newline at end of file +} diff --git a/packages/vector-pools/CHANGELOG.md b/packages/vector-pools/CHANGELOG.md index 36189f8b44..9597776ef7 100644 --- a/packages/vector-pools/CHANGELOG.md +++ b/packages/vector-pools/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.2](https://github.com/thi-ng/umbrella/compare/@thi.ng/vector-pools@0.2.1...@thi.ng/vector-pools@0.2.2) (2019-02-15) + +**Note:** Version bump only for package @thi.ng/vector-pools + + + + + ## [0.2.1](https://github.com/thi-ng/umbrella/compare/@thi.ng/vector-pools@0.2.0...@thi.ng/vector-pools@0.2.1) (2019-02-10) **Note:** Version bump only for package @thi.ng/vector-pools diff --git a/packages/vector-pools/package.json b/packages/vector-pools/package.json index 287af598ca..2cb82189ce 100644 --- a/packages/vector-pools/package.json +++ b/packages/vector-pools/package.json @@ -1,6 +1,6 @@ { "name": "@thi.ng/vector-pools", - "version": "0.2.1", + "version": "0.2.2", "description": "Data structures for managing & working with strided, memory mapped vectors", "module": "./index.js", "main": "./lib/index.js", @@ -33,8 +33,8 @@ }, "dependencies": { "@thi.ng/api": "^5.0.2", - "@thi.ng/malloc": "^2.0.1", - "@thi.ng/vectors": "^2.2.1" + "@thi.ng/malloc": "^2.0.2", + "@thi.ng/vectors": "^2.3.0" }, "keywords": [ "ES6", @@ -57,4 +57,4 @@ "setTimeout": false }, "sideEffects": false -} \ No newline at end of file +} diff --git a/packages/vectors/CHANGELOG.md b/packages/vectors/CHANGELOG.md index 25b808764d..a38cfb3772 100644 --- a/packages/vectors/CHANGELOG.md +++ b/packages/vectors/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. +# [2.3.0](https://github.com/thi-ng/umbrella/compare/@thi.ng/vectors@2.2.1...@thi.ng/vectors@2.3.0) (2019-02-15) + + +### Features + +* **vectors:** add fit, fit01, fit11 fns ([161d19d](https://github.com/thi-ng/umbrella/commit/161d19d)) + + + + + ## [2.2.1](https://github.com/thi-ng/umbrella/compare/@thi.ng/vectors@2.2.0...@thi.ng/vectors@2.2.1) (2019-02-10) **Note:** Version bump only for package @thi.ng/vectors diff --git a/packages/vectors/package.json b/packages/vectors/package.json index d5c848e7f5..b82a2a77c4 100644 --- a/packages/vectors/package.json +++ b/packages/vectors/package.json @@ -1,6 +1,6 @@ { "name": "@thi.ng/vectors", - "version": "2.2.1", + "version": "2.3.0", "description": "Optimized 2d/3d/4d and arbitrary length vector operations", "module": "./index.js", "main": "./lib/index.js", @@ -38,8 +38,8 @@ "@thi.ng/errors": "^1.0.2", "@thi.ng/math": "^1.1.0", "@thi.ng/memoize": "^1.0.2", - "@thi.ng/random": "^1.0.2", - "@thi.ng/transducers": "^4.0.1" + "@thi.ng/random": "^1.1.0", + "@thi.ng/transducers": "^5.0.0" }, "keywords": [ "2D",