MCPcopy
hub / github.com/gildas-lormeau/zip.js / readExtraFieldExtendedTimestamp

Function readExtraFieldExtendedTimestamp

index.cjs:4176–4208  ·  view source on GitHub ↗
(extraFieldExtendedTimestamp, directory, localDirectory)

Source from the content-addressed store, hash-verified

4174}
4175
4176function readExtraFieldExtendedTimestamp(extraFieldExtendedTimestamp, directory, localDirectory) {
4177 const extraFieldView = getDataView$1(extraFieldExtendedTimestamp.data);
4178 const flags = getUint8(extraFieldView, 0);
4179 const timeProperties = [];
4180 const timeRawProperties = [];
4181 if (localDirectory) {
4182 if ((flags & 0x1) == 0x1) {
4183 timeProperties.push(PROPERTY_NAME_LAST_MODIFICATION_DATE);
4184 timeRawProperties.push(PROPERTY_NAME_RAW_LAST_MODIFICATION_DATE);
4185 }
4186 if ((flags & 0x2) == 0x2) {
4187 timeProperties.push(PROPERTY_NAME_LAST_ACCESS_DATE);
4188 timeRawProperties.push(PROPERTY_NAME_RAW_LAST_ACCESS_DATE);
4189 }
4190 if ((flags & 0x4) == 0x4) {
4191 timeProperties.push(PROPERTY_NAME_CREATION_DATE);
4192 timeRawProperties.push(PROPERTY_NAME_RAW_CREATION_DATE);
4193 }
4194 } else if (extraFieldExtendedTimestamp.data.length >= 5) {
4195 timeProperties.push(PROPERTY_NAME_LAST_MODIFICATION_DATE);
4196 timeRawProperties.push(PROPERTY_NAME_RAW_LAST_MODIFICATION_DATE);
4197 }
4198 let offset = 1;
4199 timeProperties.forEach((propertyName, indexProperty) => {
4200 if (extraFieldExtendedTimestamp.data.length >= offset + 4) {
4201 const time = getUint32(extraFieldView, offset);
4202 directory[propertyName] = extraFieldExtendedTimestamp[propertyName] = new Date(time * 1000);
4203 const rawPropertyName = timeRawProperties[indexProperty];
4204 extraFieldExtendedTimestamp[rawPropertyName] = time;
4205 }
4206 offset += 4;
4207 });
4208}
4209
4210async function detectOverlappingEntry({
4211 reader,

Callers 1

readCommonFooterFunction · 0.70

Calls 3

getDataView$1Function · 0.70
getUint8Function · 0.70
getUint32Function · 0.70

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…