UNPKG

lisp-js-compiler

Version:

JavaScript compiler / interpreter for Lisp language

28 lines 769 B
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); const utils_1 = require("./utils"); function wrapFn(fn) { return async function (..._args) { let args = await utils_1.expArgs(this, _args); return await fn.apply(this, args); }; } exports.wrapFn = wrapFn; function wrapObj(obj) { let w = {}; let key, value, type; for (key in obj) { value = obj[key]; type = typeof value; if (type === 'function') { value = wrapFn(value); } else if (type === 'object' && type !== null) { value = wrapObj(value); } w[key] = value; } return w; } exports.wrapObj = wrapObj; //# sourceMappingURL=js-interop.js.map