Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
var state = renderedWidgets.state;
var config = renderedWidgets.config;
var result = {
ids: ids
};
// NOTE: Calling warp10.stringifyPrepare(obj) will produce a new object that is safe to serializing using
// JSON.stringify(). The deserialized/parsed object will need to be converted to the final object using
// warp10.finalize(obj)
if (!isObjectEmpty(state)) {
result.state = warp10.stringifyPrepare(state);
}
if (!isObjectEmpty(config)) {
result.config = warp10.stringifyPrepare(config);
}
return result;
};
exports.getRenderedWidgets = exports.getRenderedWidgetIds /* deprecated */ = function(widgetsContext) {
var renderedWidgets = getRenderedWidgets(widgetsContext);
var ids = renderedWidgets.ids;
var state = renderedWidgets.state;
var config = renderedWidgets.config;
var result = {
ids: ids
};
// NOTE: Calling warp10.stringifyPrepare(obj) will produce a new object that is safe to serializing using
// JSON.stringify(). The deserialized/parsed object will need to be converted to the final object using
// warp10.finalize(obj)
if (!isObjectEmpty(state)) {
result.state = warp10.stringifyPrepare(state);
}
if (!isObjectEmpty(config)) {
result.config = warp10.stringifyPrepare(config);
}
return result;
};
exports.getRenderedComponents = function(out) {
var renderedComponents = getRenderedComponents(out, true);
return warp10.stringifyPrepare(renderedComponents);
};