crest/middleware/newPromise

Returns a new (polyfilled) Promise. fetch().json() returns a non-Promise thenable, which cannot be polyfilled (e.g. with #finally). This middleware ensures that the resulting Promise is a (potentially) polyfilled Promise by returning a new Promise.
Source:
See:
Parameters:
Name Type Description
promise Promise.<Response> Promise from previous middleware.
Throws:
Thrown when parsing was unable to complete.
Type
ParseError
Returns:
Promise to pass to next middleware.
Type
Promise