stencila / libcore

📚 Stencila core function library
Apache License 2.0
5 stars 5 forks source link

aggregate.js: avoid `eval` #11

Open nokome opened 6 years ago

nokome commented 6 years ago

The aggregate function currently uses eval (which Rollup wrightly complains about). It is not possible to use new Function instead because Function does not use the module's scope as a closure so does not have access to summary functions like min, mean, sum etc

Use of eval and new Function() can be avoided by moving to using lambda expressions instead of strings for functions like extend, filter and aggregate.