yaas-pubsub.js
function fixEventPayload(events) {
    return new Promise(function (resolve, reject) {
        events.forEach(function(event) {
            try {
                event.payload = JSON.parse(event.payload);
            } catch (e) {
                console.log('Could not parse payload');
                return reject(new Error('Could not parse payload: ' + e.message));
            }
        });
        resolve();
    });
}
function fixEventPayload(events) {
    return new Promise(function (resolve, reject) {
        events.forEach(function(event) {
            try {
                event.payload = JSON.parse(event.payload);
            } catch (e) {
                console.log('Could not parse payload');
                return reject(new Error('Could not parse payload: ' + e.message));
            }
        });
        resolve();
    });
}
function fixEventPayload ( events ) { return new Promise ( function ( resolve , reject ) { events . forEach ( function ( event ) { try { event . payload = JSON . parse ( event . payload ) ; } catch ( e ) { console . log ( 'Could not parse payload' ) ; return reject ( new Error ( 'Could not parse payload: ' + e . message ) ) ; } } ) ; resolve ( ) ; } ) ; }
Convert PubSub event payloads into proper nested JSON
Convert PubSub event payloads into proper nested JSON