function catchAs(promise, rejectValue) {
  return Promise.resolve(promise)
    .catch(() => {
      return rejectValue;
    });
}
/**
 * Catch rejections and resolve to a given value.
 * @param {Promise} promise The promise to operate on.
 * @param {any} rejectValue The value to resolve to if a rejection occurs.
 * @returns {Promise<any>} The resolved value or the reject value if rejected.
 */
Catch rejections and resolve to a given value.
@param {Promise} promise The promise to operate on.
@param {any} rejectValue The value to resolve to if a rejection occurs.
@returns {Promise} The resolved value or the reject value if rejected.
Catch rejections and resolve to a given value . @param { Promise } promise The promise to operate on . @param { any } rejectValue The value to resolve to if a rejection occurs . @returns { Promise } The resolved value or the reject value if rejected .
function catchAs(promise, rejectValue) {
  return Promise.resolve(promise)
    .catch(() => {
      return rejectValue;
    });
}
function catchAs ( promise , rejectValue ) { return Promise . resolve ( promise ) . catch ( ( ) => { return rejectValue ; } ) ; }
Catch rejections and resolve to a given value.
Catch rejections and resolve to a given value .