Skip to content
This repository has been archived by the owner on Jul 3, 2019. It is now read-only.

Commit

Permalink
feat(manifest): annotate manifests with _from
Browse files Browse the repository at this point in the history
  • Loading branch information
zkat committed Apr 29, 2017
1 parent e15b17e commit e45e968
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 0 deletions.
1 change: 1 addition & 0 deletions manifest.js
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ function manifest (spec, opts) {
return finalizeManifest(rawManifest, spec, opts)
}).then(manifest => {
if (opts.annotate) {
manifest._from = spec.saveSpec || spec.raw
manifest._requested = spec
manifest._spec = spec.raw
manifest._where = opts.where
Expand Down
1 change: 1 addition & 0 deletions test/registry.manifest.js
Original file line number Diff line number Diff line change
Expand Up @@ -323,6 +323,7 @@ test('optionally annotates manifest with request-related metadata', t => {
where: 'right here'
}
const annotated = new Manifest(BASE)
annotated._from = 'foo@1.2.3'
annotated._requested = npa('foo@1.2.3')
annotated._spec = 'foo@1.2.3'
annotated._where = opts.where
Expand Down

0 comments on commit e45e968

Please sign in to comment.