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

Method addGlobal

packages/effect/src/encoding/Tar.ts:1298–1305  ·  view source on GitHub ↗
(records: Map<string, string>)

Source from the content-addressed store, hash-verified

1296 // Global records apply to every entry that follows, except the ones that only
1297 // describe a single entry, and an empty value removes a record
1298 private addGlobal(records: Map<string, string>): void {
1299 for (const [key, value] of records) {
1300 if (key === "path" || key === "linkpath" || key === "size") continue
1301 if (value !== "") (this.global ??= new Map()).set(key, value)
1302 else this.global?.delete(key)
1303 }
1304 if (this.global?.size === 0) this.global = undefined
1305 }
1306
1307 private toHeader(raw: RawHeader): Header {
1308 // The records of the entry's own extended header override global ones

Callers 1

advanceMethod · 0.95

Calls 2

setMethod · 0.65
deleteMethod · 0.65

Tested by

no test coverage detected