]> gerrit.simantics Code Review - simantics/district.git/blobdiff - 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
diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/lib/utils/warn-deprecated.js b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/lib/utils/warn-deprecated.js
new file mode 100644 (file)
index 0000000..ec821b9
--- /dev/null
@@ -0,0 +1,24 @@
+module.exports = warnDeprecated
+
+var log = require("npmlog")
+
+var deprecations = {}
+
+function warnDeprecated (type) {
+  return function warn (messages, instance) {
+    if (!instance) {
+      if (!deprecations[type]) {
+        deprecations[type] = {}
+        messages.forEach(function (m) { log.warn(type, m) })
+      }
+    }
+    else {
+      if (!deprecations[type]) deprecations[type] = {}
+
+      if (!deprecations[type][instance]) {
+        deprecations[type][instance] = true
+        messages.forEach(function (m) { log.warn(type, m) })
+      }
+    }
+  }
+}