GHHG10's picture
download
raw
751 Bytes
import type { RootLoadArgs } from "./types"
export async function loadRootSessionsWithFallback(input: RootLoadArgs) {
try {
const result = await input.list({ directory: input.directory, roots: true, limit: input.limit })
return {
data: result.data,
limit: input.limit,
limited: true,
} as const
} catch {
const result = await input.list({ directory: input.directory, roots: true })
return {
data: result.data,
limit: input.limit,
limited: false,
} as const
}
}
export function estimateRootSessionTotal(input: { count: number; limit: number; limited: boolean }) {
if (!input.limited) return input.count
if (input.count < input.limit) return input.count
return input.count + 1
}

Xet Storage Details

Size:
751 Bytes
·
Xet hash:
4588505d2c88470c9502300a58537fe3b79eff495ca75e0481f78fb3dc985155

Xet efficiently stores files, intelligently splitting them into unique chunks and accelerating uploads and downloads. More info.