pqb 0.3.6 → 0.3.8

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.d.ts CHANGED
@@ -551,6 +551,7 @@ declare type ThenResult<Res> = (resolve?: (value: Res) => any, reject?: (error:
551
551
  declare const queryMethodByReturnType: Record<QueryReturnType, 'query' | 'arrays'>;
552
552
  declare class Then {
553
553
  then(this: Query, resolve?: (result: any) => any, reject?: (error: any) => any): Promise<any>;
554
+ catch<T extends Query, Result>(this: T, fn: (reason: any) => Result | PromiseLike<Result>): Promise<ReturnType<T['then']> | Result>;
554
555
  }
555
556
  declare const handleResult: CommonQueryData['handleResult'];
556
557
  declare const parseResult: (q: Query, returnType: QueryReturnType | undefined, result: QueryResult) => unknown;
package/dist/index.esm.js CHANGED
@@ -3199,6 +3199,9 @@ class Then {
3199
3199
  return then(this, resolve, reject);
3200
3200
  }
3201
3201
  }
3202
+ async catch(fn) {
3203
+ return this.then(void 0, fn);
3204
+ }
3202
3205
  }
3203
3206
  const handleResult = async (q, result) => {
3204
3207
  return parseResult(q, q.query.returnType || "all", result);