@@ -58,9 +58,11 @@ Any function values are called using two possible conventions:
58
58
2 ) If no de-structure form is found in the function's arguments, the
59
59
function is only called with ` resolve ` as argument.
60
60
61
- ** Important:** Since ES6 var names can't contain special characters,
62
- destructured keys can ALWAYS only be looked up as siblings of the
63
- currently processed key.
61
+ ** Important:** ES6 destructuring can * only* be used for ES6 compile
62
+ targets and * will fail when transpiling to ES5* . If you're not sure, use
63
+ the 2nd (legacy) form. Also, since ES6 var names can't contain special
64
+ characters, destructured keys can ALWAYS only be looked up as siblings
65
+ of the currently processed key.
64
66
65
67
The ` resolve ` function provided as arg to the user function accepts a
66
68
path (** without ` @ ` prefix** ) to look up any other values in the root
@@ -135,22 +137,22 @@ import * as tx from "@thi.ng/transducers";
135
137
// will be injected later as well
136
138
const stats = {
137
139
// sequence average
138
- mean : ({src }) => tx .reduce ( tx . mean (), src ),
140
+ mean : ({ src }) => tx .mean (src ),
139
141
// sequence range
140
- range : ({min ,max }) => max - min ,
142
+ range : ({ min , max }) => max - min ,
141
143
// computes sequence min val
142
- min : ({src }) => tx .reduce ( tx . min (), src ),
144
+ min : ({ src }) => tx .min (src ),
143
145
// computes sequence max val
144
- max : ({src }) => tx .reduce ( tx . max (), src ),
146
+ max : ({ src }) => tx .max (src ),
145
147
// sorted copy
146
- sorted : ({src }) => [... src ].sort ((a , b ) => a - b ),
148
+ sorted : ({ src }) => [... src ].sort ((a , b ) => a - b ),
147
149
// standard deviation
148
- sd : ({src , mean })=>
150
+ sd : ({ src , mean })=>
149
151
Math .sqrt (
150
152
tx .transduce (tx .map ((x ) => Math .pow (x - mean , 2 )), tx .add (), src ) /
151
153
(src .length - 1 )),
152
154
// compute 10th - 90th percentiles
153
- percentiles : ({sorted }) => {
155
+ percentiles : ({ sorted }) => {
154
156
return tx .transduce (
155
157
tx .map ((x ) => sorted [Math .floor (x / 100 * sorted .length )]),
156
158
tx .push (),
0 commit comments