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

Function readCommonHeader

index-native.cjs:3953–3970  ·  view source on GitHub ↗
(directory, dataView, offset)

Source from the content-addressed store, hash-verified

3951};
3952
3953function readCommonHeader(directory, dataView, offset) {
3954 const rawBitFlag = directory.rawBitFlag = getUint16(dataView, offset + 2);
3955 const encrypted = (rawBitFlag & BITFLAG_ENCRYPTED) == BITFLAG_ENCRYPTED;
3956 const rawLastModDate = getUint32(dataView, offset + 6);
3957 Object.assign(directory, {
3958 encrypted,
3959 version: getUint16(dataView, offset),
3960 bitFlag: {
3961 level: (rawBitFlag & BITFLAG_LEVEL) >> 1,
3962 dataDescriptor: (rawBitFlag & BITFLAG_DATA_DESCRIPTOR) == BITFLAG_DATA_DESCRIPTOR,
3963 languageEncodingFlag: (rawBitFlag & BITFLAG_LANG_ENCODING_FLAG) == BITFLAG_LANG_ENCODING_FLAG
3964 },
3965 rawLastModDate,
3966 lastModDate: getDate(rawLastModDate),
3967 filenameLength: getUint16(dataView, offset + 22),
3968 extraFieldLength: getUint16(dataView, offset + 24)
3969 });
3970}
3971
3972function readCommonFooter(fileEntry, directory, dataView, offset, localDirectory) {
3973 const { rawExtraField } = directory;

Callers 2

getEntriesGeneratorMethod · 0.70
getDataMethod · 0.70

Calls 3

getUint16Function · 0.70
getUint32Function · 0.70
getDateFunction · 0.70

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…