react-code-view
Version:
Code view for React
9 lines • 340 B
JavaScript
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;