subscript
subscript copied to clipboard
Fast and tiny expression evaluator with minimal syntax.
https://www.npmjs.com/package/scopex
My IDE might have found an error: https://github.com/dy/subscript/blob/098f480fe5a87d21a030b0ef084c57423b0125ec/subscript.js#L19 the third parameter expects a number: https://github.com/dy/subscript/blob/098f480fe5a87d21a030b0ef084c57423b0125ec/parse.js#L81
Rewriting to Typescript could help with understandability and bugs like this, with negligible reduction in performance - [x] I'm willing to implement this feature myself
The library is nice but is dangerous to load arbitrary expressions as they can execute arbitrary code like this: const fn = subscript("Math.constructor.constructor('alert(1)')()"); fn({ Math }) suggestion: disable access to...