var now = new Date(1987, 1, 19), j = 0; // Track which names exist var fullPaths = Object.create ? Object.create(null) : {}; var data/*:Array<[string, CFBEntry]>*/ = []; for(i = 0; i < cfb.FullPaths.length; ++i) { fullPaths[cfb.FullPaths[i]] = true; 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 = fullPaths[dad]; if(!s) { data.push([dad, ({ name: filename(dad).replace("/",""), type: 1, clsid: HEADER_CLSID, ct: now, mt: now, content: null }/*:any*/)]); // Add name to set fullPaths[dad] = true; } }