@commercelayer/sdk 2.1.0-alpha.6 → 2.1.0-alpha.7

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/lib/error.d.ts CHANGED
@@ -14,6 +14,7 @@ declare class ApiError extends Error {
14
14
  message: string;
15
15
  type?: ErrorType;
16
16
  });
17
+ first(): any;
17
18
  }
18
19
  export default ApiError;
19
20
  export { ErrorType };
@@ -969,6 +969,12 @@ var ApiError = /*#__PURE__*/function (_Error) {
969
969
  return error && error.name === 'ApiError' && error.type === ErrorType.RESPONSE;
970
970
  };
971
971
 
972
+ var _proto = ApiError.prototype;
973
+
974
+ _proto.first = function first() {
975
+ return this.errors.length > 0 ? this.errors[0] : undefined;
976
+ };
977
+
972
978
  return ApiError;
973
979
  }( /*#__PURE__*/_wrapNativeSuper(Error));
974
980