fix(types): use concrete Node stat result type (#10017)

This commit is contained in:
Brennan Benson
2026-07-22 17:11:55 -07:00
committed by GitHub
parent 43ae014a64
commit db56a9b7f3
2 changed files with 4 additions and 6 deletions
@@ -1,3 +1,4 @@
import type { Stats } from 'node:fs'
import { readFile, stat } from 'node:fs/promises'
import type { Repo } from '../../shared/types'
import {
@@ -7,7 +8,7 @@ import {
} from '../../shared/cross-platform-path'
import type { FileStat } from '../providers/types'
type GitDirectoryStat = Awaited<ReturnType<typeof stat>> | FileStat
type GitDirectoryStat = Stats | FileStat
type GitDirectoryAccess = {
stat?: (path: string) => Promise<GitDirectoryStat>
@@ -1,5 +1,5 @@
import { createHash } from 'node:crypto'
import { constants } from 'node:fs'
import { constants, type Stats } from 'node:fs'
import { access, lstat, realpath, stat } from 'node:fs/promises'
import { dirname, normalize, resolve } from 'node:path'
import type { SkillInstallationTopology } from '../../shared/skill-freshness'
@@ -26,10 +26,7 @@ export function normalizedSkillIdentityPath(value: string): string {
return process.platform === 'win32' ? normalized.toLocaleLowerCase('en-US') : normalized
}
export function skillPhysicalIdentity(
resolvedPath: string,
fileStat: Awaited<ReturnType<typeof stat>>
): string {
export function skillPhysicalIdentity(resolvedPath: string, fileStat: Stats): string {
const inodeIdentity = fileStat.dev || fileStat.ino ? `${fileStat.dev}:${fileStat.ino}` : null
return inodeIdentity ?? normalizedSkillIdentityPath(resolvedPath)
}