UNPKG

@viewdo/dxp-story-cli

Version:
18 lines (15 loc) 509 B
module.exports = function (source) { const { inputs, preview, events, thumbnailUrl, description, name, key, episodes } = JSON.parse(source); const newConfig = Object.assign({}, preview); newConfig.story = Object.assign({}, { inputs, events, storyEvents: events.map(event => { return { key: event, name: event, created: Date.now() } }), key, description, name, thumbnailUrl, episodes }); return JSON.stringify(newConfig); }