UNPKG

ashish-sdk

Version:
17 lines 489 B
import { EmbedEvent } from '../types'; export function getViewPropsAndListeners(props) { return Object.keys(props).reduce((accu, key) => { if (key.startsWith('on')) { const eventName = key.substr(2); accu.listeners[EmbedEvent[eventName]] = props[key]; } else { accu.viewConfig[key] = props[key]; } return accu; }, { viewConfig: {}, listeners: {}, }); } //# sourceMappingURL=util.js.map