refactor: standardize runtime guard patterns with lodash-es (#154)
* refactor(ui): replace runtime type guards with lodash-es predicates * refactor(runtime): migrate typeof checks to lodash-es in core modules * refactor(ipc): standardize runtime guards with lodash-es * test(refactor): align runtime guard checks with lodash-es * docs(agents): add lodash-es runtime guard skill summary
This commit is contained in:
33 files changed
+303
-208
No files matched your search
@@ -1,3 +1,5 @@
|
||||
import { isString } from 'lodash-es';
|
||||
|
||||
export const RATE_LIMIT_HINTS = [
|
||||
'resource_exhausted',
|
||||
'too many requests',
|
||||
@@ -40,7 +42,7 @@ export function extractErrorMessage(error: unknown): string {
|
||||
if (error instanceof Error) {
|
||||
return error.message;
|
||||
}
|
||||
if (typeof error === 'string') {
|
||||
if (isString(error)) {
|
||||
return error;
|
||||
}
|
||||
return String(error);
|
||||
|
||||
Reference in new issue
Block a user