UNPKG

get-folder

Version:

High-Performance Folder Size Calculator.

42 lines (41 loc) 1.28 kB
import { BigIntStats, Stats } from "node:fs"; export declare class BaseScene { /** * 已处理的硬链接 */ protected readonly processedInodes: Set<string>; /** * 检查是否应该忽略指定路径 * @param ignores 忽略列表 * @param itemPath 项目路径 * @param includeHidden 是否包含隐藏文件 * @returns 是否应该忽略 */ protected shouldIgnorePath(ignores: RegExp[], itemPath: string, includeHidden?: boolean): boolean; /** * 获取inode关键值,如果stats为字符串让直接返回 * @param stats fs统计信息 */ protected getInodeKey(stats: string | BigIntStats | Stats): string; /** * 判断是否已有 inode * @param inode inode */ protected hasInode(inode: string | BigIntStats | Stats): boolean; /** * 添加 inode * @param inode inode */ protected addInode(inode: string | BigIntStats | Stats): void; /** * 检查 inode,用于防止硬链接重复 * * 如果已有inode将返回true,否则记录inode并返回false * @param stats fs统计信息 */ protected checkInode(stats: BigIntStats | Stats): boolean; /** * 清除 inode */ protected clearInode(): void; }