UNPKG

react-code-view

Version:
9 lines 340 B
import _construct from "@babel/runtime/helpers/esm/construct"; var evalCode = function evalCode(code, scope) { var scopeKeys = Object.keys(scope); var scopeValues = scopeKeys.map(function (key) { return scope[key]; }); return _construct(Function, scopeKeys.concat([code])).apply(void 0, scopeValues); }; export default evalCode;