]> gerrit.simantics Code Review - simantics/district.git/blob - org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/lib/utils/warn-deprecated.js
Adding integrated tile server
[simantics/district.git] / org.simantics.maps.server / node / node-v4.8.0-win-x64 / node_modules / npm / lib / utils / warn-deprecated.js
1 module.exports = warnDeprecated
2
3 var log = require("npmlog")
4
5 var deprecations = {}
6
7 function warnDeprecated (type) {
8   return function warn (messages, instance) {
9     if (!instance) {
10       if (!deprecations[type]) {
11         deprecations[type] = {}
12         messages.forEach(function (m) { log.warn(type, m) })
13       }
14     }
15     else {
16       if (!deprecations[type]) deprecations[type] = {}
17
18       if (!deprecations[type][instance]) {
19         deprecations[type][instance] = true
20         messages.forEach(function (m) { log.warn(type, m) })
21       }
22     }
23   }
24 }