Welcome to mirror list, hosted at ThFree Co, Russian Federation.

and-add-parent-to-errors.js « install « lib - github.com/npm/cli.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
blob: 62a86bd4a6c36090c7457955d5cedf1dd05b35de (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
'use strict'
var validate = require('aproba')

module.exports = function (parent, cb) {
  validate('F', [cb])
  return function (er) {
    if (!er) return cb.apply(null, arguments)
    if (er instanceof Error && parent && parent.package && parent.package.name) {
      er.parent = parent.package.name
    }
    cb(er)
  }
}