You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 
 

23 lines
451 B

'use strict'
const log = require('npmlog')
const deprecated = {}
const deprWarned = {}
module.exports = deprCheck
function deprCheck (data) {
if (deprecated[data._id]) {
data.deprecated = deprecated[data._id]
}
if (data.deprecated) {
deprecated[data._id] = data.deprecated
if (!deprWarned[data._id]) {
deprWarned[data._id] = true
log.warn('deprecated', '%s: %s', data._id, data.deprecated)
}
}
return data
}