lib/alexa-remote-ext.js
// my own implementation to keep track of the value on errors, for debugging
my own implementation to keep track of the value on errors, for debugging
my own implementation to keep track of the value on errors for debugging
function promisify(fun) {
	return (function() {
		return new Promise((resolve, reject) => {
			fun.bind(this)(...arguments, (err, val) => {
                if(err) {
                    if(typeof err === 'object') {
                        err.value = val;   
                    }
					reject(err);
                }
				else {
					resolve(val);
                }
			});
		});
	});
}
function promisify ( fun ) { return ( function ( ) { return new Promise ( ( resolve , reject ) => { fun . bind ( this ) ( ... arguments , ( err , val ) => { if ( err ) { if ( typeof err === 'object' ) { err . value = val ; } reject ( err ) ; } else { resolve ( val ) ; } } ) ; } ) ; } ) ; }
my own implementation to keep track of the value on errors, for debugging
my own implementation to keep track of the value on errors for debugging