refactor(notes): rename candidate variable in isNote guard
This commit is contained in:
1 parent
0bfda59cb5
commit
32e8bc7837
1 file changed
+4
-4
@@ -21,10 +21,10 @@ export function saveNotes(notes: Note[]): void {
|
|||||||
|
|
||||||
function isNote(value: unknown): value is Note {
|
function isNote(value: unknown): value is Note {
|
||||||
if (typeof value !== 'object' || value === null) return false
|
if (typeof value !== 'object' || value === null) return false
|
||||||
const candidate = value as Record<string, unknown>
|
const note = value as Record<string, unknown>
|
||||||
return (
|
return (
|
||||||
typeof candidate.id === 'number' &&
|
typeof note.id === 'number' &&
|
||||||
typeof candidate.title === 'string' &&
|
typeof note.title === 'string' &&
|
||||||
typeof candidate.content === 'string'
|
typeof note.content === 'string'
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
Reference in new issue
Block a user