UNPKG

@alexkeating/common-utilities

Version:

Our **Common Utilities** package is a set of helper tools and utilities that are used throughout our libraries and apps. This includes things like our constants, types that are commonly shared across packages, and various utilities and helper functions.

16 lines 562 B
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.handleErrorMessage = void 0; // eslint-disable-next-line @typescript-eslint/no-explicit-any const hasMessage = (value) => value.message !== undefined; const handleErrorMessage = ({ error, fallback = 'Could not decode error message', }) => { if (hasMessage(error)) { return error.message; } if (typeof error === 'string') { return error; } return fallback; }; exports.handleErrorMessage = handleErrorMessage; //# sourceMappingURL=error.js.map