js-cfb/bits/56_dirtree.js
SheetJS 3fd73f806b version bump 0.13.1: determinism
- pin unknown dates and zero-fill end of file
- cfb_add can take an absolute path e.g. "/Workbook"
2017-09-20 19:33:03 -04:00

20 lines
542 B
JavaScript

var now = new Date(1987, 1, 19), j = 0;
var data/*:Array<[string, CFBEntry]>*/ = [];
for(i = 0; i < cfb.FullPaths.length; ++i) {
if(cfb.FileIndex[i].type === 0) continue;
data.push([cfb.FullPaths[i], cfb.FileIndex[i]]);
}
for(i = 0; i < data.length; ++i) {
var dad = dirname(data[i][0]);
s = false;
for(j = 0; j < data.length; ++j) if(data[j][0] === dad) s = true;
if(!s) data.push([dad, ({
name: filename(dad).replace("/",""),
type: 1,
clsid: HEADER_CLSID,
ct: now, mt: now,
content: null
}/*:any*/)]);
}