GHHG10's picture
download
raw
613 Bytes
const LARGE_PASTE_CHARS = 8000
const LARGE_PASTE_BREAKS = 120
function largePaste(text: string) {
if (text.length >= LARGE_PASTE_CHARS) return true
let breaks = 0
for (const char of text) {
if (char !== "\n") continue
breaks += 1
if (breaks >= LARGE_PASTE_BREAKS) return true
}
return false
}
export function normalizePaste(text: string) {
if (!text.includes("\r")) return text
return text.replace(/\r\n?/g, "\n")
}
export function pasteMode(text: string) {
if (largePaste(text)) return "manual"
if (text.includes("\n") || text.includes("\r")) return "manual"
return "native"
}

Xet Storage Details

Size:
613 Bytes
·
Xet hash:
e99512d7bf51677fff71bb3243c0e4fa19dbefc824c98e467fa3e123e5ac8281

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