Skip to content

Commit f25ea5e

Browse files
committed
refactor(useDate): use utility functions for type checks
Replace raw typeof/null checks with isString and isNull utilities for consistency with codebase patterns.
1 parent 7880658 commit f25ea5e

File tree

1 file changed

+3
-3
lines changed
  • packages/0/src/composables/useDate/adapters

1 file changed

+3
-3
lines changed

packages/0/src/composables/useDate/adapters/v0.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ import { Temporal } from '@js-temporal/polyfill'
2020
import { IN_BROWSER } from '#v0/constants/globals'
2121

2222
// Utilities
23-
import { isNullOrUndefined, isNumber, isString } from '#v0/utilities'
23+
import { isNull, isNullOrUndefined, isNumber, isString } from '#v0/utilities'
2424

2525
// Types
2626
import type { DateAdapter } from './adapter'
@@ -525,9 +525,9 @@ export class Vuetify0DateAdapter implements DateAdapter<PlainDateTime> {
525525
unit?: string,
526526
): number {
527527
const unitKey = (unit ?? 'days') as 'years' | 'months' | 'weeks' | 'days' | 'hours' | 'minutes' | 'seconds'
528-
const comp = typeof comparing === 'string' ? this.date(comparing) : comparing
528+
const comp = isString(comparing) ? this.date(comparing) : comparing
529529

530-
if (comp === null) return 0
530+
if (isNull(comp)) return 0
531531

532532
const duration = date.since(comp, { largestUnit: unitKey })
533533

0 commit comments

Comments
 (0)