diff --git a/template/tinyvue/src/utils/base-utils.ts b/template/tinyvue/src/utils/base-utils.ts index 26490c1..4fb69ab 100644 --- a/template/tinyvue/src/utils/base-utils.ts +++ b/template/tinyvue/src/utils/base-utils.ts @@ -1,5 +1,11 @@ import { CommonError } from '@/types/global'; +/** + * Determines whether a value conforms to the CommonError shape. + * + * @param error - The value to test for a CommonError-like object + * @returns `true` if `error` is a non-null object that has a `message` property of type `string`, `false` otherwise. + */ export function isCommonError(error: unknown): error is CommonError { return ( typeof error === 'object' && @@ -28,4 +34,4 @@ export default class BaseUtils { return new Error(String(error)); } } -} +} \ No newline at end of file