Skip to content

Commit

Permalink
fix(packument): eliminate _cached field (#175)
Browse files Browse the repository at this point in the history
BREAKING CHANGE: the `_cached` attribute has been removed from packuments.
  • Loading branch information
jablko authored Sep 22, 2022
1 parent dd231c9 commit 8ca3751
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 3 deletions.
3 changes: 1 addition & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -276,7 +276,6 @@ For Pacote's purposes, the following fields are relevant:
* `time` In the full packument, an object mapping version numbers to
publication times, for the `opts.before` functionality.

Pacote adds the following fields, regardless of the accept header:
Pacote adds the following field, regardless of the accept header:

* `_cached` Whether the packument was fetched from the network or the local cache.
* `_contentLength` The size of the packument.
1 change: 0 additions & 1 deletion lib/registry.js
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,6 @@ class RegistryFetcher extends Fetcher {
integrity: null,
})
const packument = await res.json()
packument._cached = res.headers.has('x-local-cache')
packument._contentLength = +res.headers.get('content-length')
if (this.packumentCache) {
this.packumentCache.set(this.packumentUrl, packument)
Expand Down

0 comments on commit 8ca3751

Please sign in to comment.