UNPKG

@thoughtspot/visual-embed-sdk

Version:
25 lines 696 B
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.getViewPropsAndListeners = void 0; const types_1 = require("../types"); /** * * @param props */ function getViewPropsAndListeners(props) { return Object.keys(props).reduce((accu, key) => { if (key.startsWith('on')) { const eventName = key.substr(2); accu.listeners[types_1.EmbedEvent[eventName]] = props[key]; } else { accu.viewConfig[key] = props[key]; } return accu; }, { viewConfig: {}, listeners: {}, }); } exports.getViewPropsAndListeners = getViewPropsAndListeners; //# sourceMappingURL=util.js.map