Spaces:
Running
Running
Download run_csv.mjs from WideChaos/http-range-desk: direct link, hf CLI and curl.
- Browser
- Download file 787 Bytes
-
https://huggingface.co/spaces/WideChaos/http-range-desk/resolve/main/run_csv.mjs
- Command line
-
hf download hf://spaces/WideChaos/http-range-desk/run_csv.mjs
-
curl -L -o run_csv.mjs https://huggingface.co/spaces/WideChaos/http-range-desk/resolve/main/run_csv.mjs
787 Bytes
| /* Explicit export boundaries: empty diagnostics and huge decimal offsets. */ | |
| import fs from'node:fs';import{makeReport,reportCsv}from'./core.mjs';let base=JSON.parse(fs.readFileSync('default-request.json','utf8')),cases=[{id:'empty',q:{...base,resource:{...base.resource,length:'0'},range:'bytes=-1'}},{id:'outside',q:{...base,range:'bytes='+Array(65).fill('0-0').join(',')}},{id:'huge',q:{...base,resource:{...base.resource,length:'9223372036854775807'},range:'bytes=9007199254740993-9007199254740995,-2'}}];fs.mkdirSync('csv-proof',{recursive:true});for(let c of cases){let r=await makeReport(c.q);fs.writeFileSync('csv-proof/'+c.id+'.json',JSON.stringify(r,null,2)+'\n');fs.writeFileSync('csv-proof/'+c.id+'.csv',reportCsv(r));}console.log({CSV_export_boundary_cases:cases.length}); | |