helene
Version:
Real-time Web Apps for Node.js
19 lines • 748 B
JavaScript
;
Object.defineProperty(exports, "__esModule", { value: true });
exports.toJSONValueHelper = void 0;
/**
* Either return the JSON-compatible version of the argument, or undefined (if
* the item isn't itself replaceable, but maybe some fields in it are)
*/
const built_in_converters_1 = require("../built-in-converters");
const toJSONValueHelper = item => {
for (let i = 0; i < built_in_converters_1.builtinConverters.length; i++) {
const converter = built_in_converters_1.builtinConverters[i];
if (converter.matchObject(item)) {
return converter.toJSONValue(item);
}
}
return undefined;
};
exports.toJSONValueHelper = toJSONValueHelper;
//# sourceMappingURL=to-json-value-helper.js.map