UNPKG

@tdb/util

Version:
21 lines 596 B
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); function toObject(obj, ctx) { var result = {}; Object.keys(obj) .map(function (key) { return ({ key: key, prop: obj[key] }); }) .filter(function (_a) { var prop = _a.prop; return prop.isProp; }) .forEach(function (_a) { var key = _a.key, prop = _a.prop; var value = prop(undefined, { ctx: ctx }); if (value) { result[key] = value; } }); return result; } exports.toObject = toObject; //# sourceMappingURL=util.js.map