MCPcopy Create free account
hub / github.com/Effect-TS/effect / entry

Method entry

packages/effect/src/encoding/Zip.ts:1122–1133  ·  view source on GitHub ↗
(header: Header, content: Uint8Array, data: Uint8Array)

Source from the content-addressed store, hash-verified

1120
1121 // Writes an entry whose content is known, with its sizes in the local header
1122 entry(header: Header, content: Uint8Array, data: Uint8Array): void {
1123 const size = header.type === "Directory" ? 0 : header.size
1124 if (size !== undefined && size !== content.length) throw sizeMismatch(header.path, content.length, size)
1125 const record = this.record(header, 0)
1126 record.crc = crc32(0, content)
1127 record.size = content.length
1128 record.compressedSize = data.length
1129 record.zip64 = record.size >= MAX32 || record.compressedSize >= MAX32
1130 this.push(localHeader(record))
1131 if (data.length > 0) this.push(data)
1132 this.records.push(record)
1133 }
1134
1135 // Starts an entry whose sizes and CRC-32 follow its data
1136 begin(header: Header): void {

Callers 1

encodeFunction · 0.95

Calls 6

recordMethod · 0.95
pushMethod · 0.95
sizeMismatchFunction · 0.70
crc32Function · 0.70
localHeaderFunction · 0.70
pushMethod · 0.65

Tested by

no test coverage detected