@scayle/storefront-nuxt
Version:
Nuxt integration for the SCAYLE Commerce Engine and Storefront API
13 lines (12 loc) • 378 B
JavaScript
export function extendPromise(promise, source) {
const newPromise = promise.then(
(result) => Object.assign(result, source)
);
const withoutPromise = Object.assign({}, promise);
for (const key of Object.getOwnPropertyNames(
Promise.prototype
)) {
delete withoutPromise[key];
}
return Object.assign(newPromise, Object.assign(withoutPromise, source));
}